Transparent Object Proxies for JavaScript
by Matthias Keil and Peter Thiemann
A proxy, or wrapper, is an object that mediates access to an arbitrary target object. Proxies are widely used to perform resource management, access remote objects, impose access control, restrict the functionality of an object, or to enhance the interface of an object. Ideally, a proxy is not distinguishable from other objects so that running a program with an interposed proxy should lead to the same outcome as running the program with the target object, unless the proxy imposes restrictions.
Proxies introduce a subtle problem. Because a target object may have any number of proxy objects, which are all different from the target, a single target object may obtain multiple identities---it suffers from schizophrenia! Even worse, it turns out that there is no single cure for this schizophrenia because the desired behavior depends on the use case.
Unfortunately, current proxy implementations are committed to particular use cases, which makes it hard to adapt them to uses with different requirements. We discuss two such use cases in the context of the JavaScript proxy API, identify its shortcomings, and propose a solution.
Software Download
- git clone https://github.com/of99/gecko-dev/tree/global-tproxy-object
- git clone https://github.com/sankha93/js-tproxy
Publications
Research Paper
-
Matthias Keil, Sankha Narayan Guria, Andreas Schlegel, Manuel Geffken, Peter Thiemann
Transparent Object Proxies for JavaScript
The European Conference on Object-Oriented Programming, ECOOP 2015
Prague, Czech Republic, July 5-10, 2015
-
Matthias Keil, Sankha Narayan Guria, Andreas Schlegel, Manuel Geffken, Peter Thiemann
Transparent Object Proxies in JavaScript (Technical Report)
Institute for Computer Science, University of Freiburg
-
Matthias Keil, Peter Thiemann
On the Proxy Identity Crisis (Position Paper)
Institute for Computer Science, University of Freiburg
Artifacts
-
Matthias Keil, Sankha Narayan Guria, Andreas Schlegel, Manuel Geffken, Peter Thiemann
Transparent Object Proxies for JavaScript (Artifact)
The European Conference on Object-Oriented Programming, ECOOP 2015
Prague, Czech Republic, July 5-10, 2015
Related Work
-
Matthias Keil, Peter Thiemann
TreatJS: Higher-Order Contracts for JavaScript
The European Conference on Object-Oriented Programming, ECOOP 2015
Prague, Czech Republic, July 5-10, 2015
-
Matthias Keil, Peter Thiemann
TreatJS: Higher-Order Contracts for JavaScripts (Technical Report)
Institute for Computer Science, University of Freiburg
-
Matthias Keil, Peter Thiemann
Efficient Dynamic Access Analysis Using JavaScript Proxies
Dynamic Languages Symposium 2013, DLS'13
Indianapolis, Indiana, USA, October 28, 2013
-
Matthias Keil, Peter Thiemann
Efficient Dynamic Access Analysis Using JavaScript Proxies (Technical Report)
Institute for Computer Science, University of Freiburg