2015-04-21 22:15 GMT+02:00 Allen Wirfs-Brock <[email protected]>:
>
> Yes, I considered that possibility in deciding upon the proposed change.
> The reason I error out if the Receiver property is an accessor is because I
> think the most likely way this scenario will occur is when that that access
> includes a `super.prop` assignment. That would result in an infinite
> [[Set]] recursion. For example:
>
> ```
> var y = {
> __proto__: x,
> set prop(v) {
> // ...
> super.prop = v;
> }
> };
> y.prop = 42;
> ```
>
Assuming `x` here is the object where "prop" is bound to an accessor, can
you clarify how this would lead to an infinite recursion?
y.prop = 42; // 9.1.9 step 2 binds ownDesc to y's accessor, and calls it in
step 9
super.prop = v; // 9.1.9 step 2 binds ownDesc to x's accessor, and calls it
in step 9
x's setter then runs `v = n;` and the assignment terminates
I must be missing something?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss