Proxies: wrong "receiver" used in default "set" trap

Andreas Rossberg rossberg at google.com
Wed Dec 19 00:12:30 PST 2012


On 18 December 2012 22:56, Tom Van Cutsem <tomvc.be at gmail.com> wrote:

> Option B:
> Address point 2) directly by changing the test that determines property
> addition versus property update inside Reflect.set (i.e. the [[SetP]]
> internal method of objects) so that the algorithm no longer tests whether
> target === receiver, but rather whether target === receiver || receiver is
> a proxy for target.
>
> This solves the issue at hand, although it feels like a more ad hoc
> solution.
>

Indeed, especially since the length of the proxy chain may be >1.

So it has to be A. (Or the definition of Reflect.set has to change. I don't
have much love for the case distinction in there anyway. But it's probably
a necessary consequence of the somewhat incoherent property assignment
model we are stuck with.)

/Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121219/3044404f/attachment.html>


More information about the es-discuss mailing list