d at domenic.me (2015-05-01T13:06:11.355Z)
2015-04-21 22:15 GMT+02:00 Allen Wirfs-Brock <allen at wirfs-brock.com>: > That would result in an infinite [[Set]] recursion. For example: Assuming `x` here is the object where "prop" is bound to an accessor, can you clarify how this would lead to an infinite recursion? ```js 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?
2015-04-21 22:15 GMT+02:00 Allen Wirfs-Brock <allen at wirfs-brock.com>: > > 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150422/6b9b0c55/attachment.html>