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:
>> https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Proxy#Common_mistakes_and_misunderstanding
> I have seen this example.  I was trying to indicate that it appears to
> exhibit incorrect behavior.  The proxy's "get" trap should not be
> called, but rather its "getPropertyDescriptor" trap.  And similarly
> when a proxy is encountered in a prototype chain, its "set" trap
> should not be called, but again its "getPropertyDescriptor" trap.
Oh ok, sorry. So in that case, this is something that has been discussed
already a couple of times. The internal object API is a bit inconsistent
with proxy traps intentions, especially when it comes to recursive calls
to traps on the prototype.
If I recall correctly, Allen Wirfs-Brock is working on rewriting object
internal methods so that they are both semantically equivalent to what
we know and coherent with what we expect from proxies.
Maybe we should start filing bugs on the topic at
https://bugs.ecmascript.org/ ?

Tom, are their tests for such prototype-climbing issue?

David
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to