Tom Van Cutsem
tomvc.be at gmail.com
Wed Sep 28 00:19:38 PDT 2011
2011/9/27 David Bruant <david.bruant at labri.fr>
> I just wanted to give a follow-up on that. I implemented it:
Also, I implemented another flavor of Forwarder (similar to ) which
> explicitly calls Object.getPrototypeOf when needed (which allows me to
> return a different value when needed). I have no opinion on whether it's
> better or worse, but i just wanted to point it out.
Right, I've also been thinking about this. There are two possible forwarding
1) one that uses the "virtual" prototype passed to Proxy.create
2) one that uses Object.getPrototypeOf(target)
Option #2 is what's in the proposal . I think that's a safe bet, since
most proxies will not want to interfere with the prototype chain and will
probably even set the virtual prototype equal to the target's prototype, in
which case #1 and #2 are the same. We could make the choice between #1 and
#2 configurable, but I don't think it's worth the additional complexity.
>  http://wiki.ecmascript.org/doku.php?id=harmony:proxy_defaulthandler
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss