Converting an existing object to a proxy
brendan at mozilla.com
Fri May 27 02:35:43 PDT 2011
On May 27, 2011, at 2:26 AM, David Bruant wrote:
> Le 27/05/2011 04:13, Mark S. Miller a écrit :
>> On Thu, May 26, 2011 at 5:04 PM, Cormac Flanagan <cormac at cs.ucsc.edu> wrote:
>> [documenting/expanding some ideas briefly discussed at today's meeting]
>> The current proxy proposal has a method to create a new proxy:
>> var proxy = Proxy.create(handler, proto);
>> We could extend this proposal to allow an existing object to be
>> converted to a proxy, via:
>> var proxy = Proxy.createFrom(object, handler, proto);
> I am surprised by this proposal since a design goal of proxies was to not be able to turn existing objects into proxies.
> 4th "driving force" of the proxy proposal:
> "security: avoid enabling arbitrary ES objects to be able to intercept the properties of another object"
That is not the same as "avoid turning an object into a proxy", though.
The idea of permitting this "becomes" operation only for extensible objects with configurable properties is crucial.
The motivation is to unify ideas in proxies (in Harmony) with those proposed in http://wiki.ecmascript.org/doku.php?id=strawman:observe.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss