The ES6 MOP (Was: New ES6 draft now available)
bruant.d at gmail.com
Mon Nov 26 10:13:06 PST 2012
Le 26/11/2012 19:00, Tom Van Cutsem a écrit :
> 2012/11/24 Allen Wirfs-Brock <allen at wirfs-brock.com
> <mailto:allen at wirfs-brock.com>>
> I see that  call for filtering __proto__ access in Get/Put
> handlers. I think that dealing with it in a Get/SetInheritance
> handler would be a much more efficient way to hand this extremely
> rare operation. Rather than filtering for it on every property
> access, an handler that cares only needs to worry about the actual
> Hmm, so you're arguing that proxy.__proto__ would be equivalent to
> Object.getPrototypeOf(proxy), and trigger the "getPrototypeOf" trap,
> rather than triggering the "get" trap?
> I guess that more accurately reflects the magical behavior of __proto__.
The magical behavior as it currently is in some engines, but not how
it's described in the current strawman:
var o = Object.create(null);
var a = o.__proto__;
a is undefined according to the current strawman. In this case, the
"get" trap is what should be called if o was a proxy.
With __proto__ spec'ed as in the strawman (own Object.prototype
property), "get" really is the accurate trap.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss