The ES6 MOP (Was: New ES6 draft now available)
Tom Van Cutsem
tomvc.be at gmail.com
Mon Nov 26 10:00:02 PST 2012
2012/11/24 Allen Wirfs-Brock <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 Get/SetInhertiance.
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__.
Paradoxically, this will move the filter check into the proxy
implementation itself, to properly intercept proxy["__proto__"]. On first
sight, this seems to introduce more overhead.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss