Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-05-04 Thread Tom Van Cutsem
I wrote up a draft strawman for making this change: http://wiki.ecmascript.org/doku.php?id=strawman:proxy_drop_receiver. 2011/4/28 Tom Van Cutsem tomvc...@gmail.com Hi, I think Sean is correct: under the ES5 semantics, the receiver argument to get and set is not required, because get and

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-28 Thread David Bruant
Le 27/04/2011 23:09, Sean Eagan a écrit : As explained before, the existing ES5 semantics would cause the proxy's getPropertyDescriptor trap to be called thus obtaining any getter / setter that the proxy wants. The |this| binding of this getter / setter will then be set to the receiver by ES5

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-28 Thread Andreas Gal
On Apr 28, 2011, at 1:26 AM, David Bruant wrote: Le 27/04/2011 23:09, Sean Eagan a écrit : As explained before, the existing ES5 semantics would cause the proxy's getPropertyDescriptor trap to be called thus obtaining any getter / setter that the proxy wants. The |this| binding of this

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-28 Thread Tom Van Cutsem
Hi, I think Sean is correct: under the ES5 semantics, the receiver argument to get and set is not required, because get and set are not supposed to be invoked on a proxy acting as a prototype. In both cases, property lookup is indeed via [[GetProperty]]. That means get will only ever be invoked

[Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread Sean Eagan
Hi, The get and set traps currently have both receiver and proxy arguments. This is because it has been suggested that they are not the same in the case of property access on a receiver causing a [[Get]] / [[Put]] call to propogate up the prototype chain to a proxy. From what I can tell though,

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread David Bruant
Le 27/04/2011 19:38, Sean Eagan a écrit : Hi, The get and set traps currently have both receiver and proxy arguments. This is because it has been suggested that they are not the same in the case of property access on a receiver causing a [[Get]] / [[Put]] call to propogate up the prototype

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread Sean Eagan
Hi David, On Wed, Apr 27, 2011 at 1:17 PM, David Bruant david.bru...@labri.fr wrote: The case when they are not the same is when the proxy is in the prototype chain (regardless of what kind of object is underneath). See the third example at:

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread David Bruant
Le 27/04/2011 20:37, Sean Eagan a écrit : Hi David, On Wed, Apr 27, 2011 at 1:17 PM, David Bruant david.bru...@labri.fr wrote: The case when they are not the same is when the proxy is in the prototype chain (regardless of what kind of object is underneath). See the third example at:

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread Sean Eagan
This can also be seen by realizing that if proxyA's handler uses the default get and set trap implementations, and proxyB is proxyA's [[Prototype]], then proxyB's get and set traps will not be called due to property access on proxyA, but rather its getPropertyDescriptor trap. Thanks, Sean Eagan

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread Sean Eagan
Sorry, ignore the first paragraph in my last post, I included it at the end instead. Thanks. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread David Bruant
Le 27/04/2011 21:15, Sean Eagan a écrit : This can also be seen by realizing that if proxyA's handler uses the default get and set trap implementations, and proxyB is proxyA's [[Prototype]], then proxyB's get and set traps will not be called due to property access on proxyA, but rather its

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread Sean Eagan
On Wed, Apr 27, 2011 at 2:46 PM, David Bruant david.bru...@labri.fr wrote: You're right. get and set default traps were chosen to follow closely internal methods (see [1]) and at the time when proxy wasn't an argument of all traps (so a proxy's prototype wasn't reachable from the handler). It

Re: [Harmony Proxies] get/set trap receiver argument unnecessary

2011-04-27 Thread Brendan Eich
On Apr 27, 2011, at 2:09 PM, Sean Eagan wrote: As explained before, the existing ES5 semantics would cause the proxy's getPropertyDescriptor trap to be called thus obtaining any getter / setter that the proxy wants. The |this| binding of this getter / setter will then be set to the receiver