RESOLVED DUPLICATE of bug 78409 78438
Failed strict assignment to __proto__ not throwing
https://bugs.webkit.org/show_bug.cgi?id=78438
Summary Failed strict assignment to __proto__ not throwing
Mark S. Miller
Reported 2012-02-12 14:18:05 PST
In Version 5.1.2 (7534.52.7, r107511): > var x = Object.preventExtensions({}); > var y = {}; > function foo(){"use strict"; x.__proto__ = y;} > Object.getPrototypeOf(x) === Object.prototype true > foo() > Object.getPrototypeOf(x) === Object.prototype true The above behavior correctly does not mutate x.__proto__, however, since it is a failed assignment and foo() is strict, the call to foo() should have thrown an exception. Instead it failed silently.
Attachments
Mark S. Miller
Comment 1 2012-02-12 14:20:02 PST
Mark S. Miller
Comment 2 2012-02-12 14:24:31 PST
On Version 5.1.2 (7534.52.7) I get > foo() TypeError: Attempted to assign to readonly property. which is correct, so this is a regression.
Gavin Barraclough
Comment 3 2012-02-12 19:02:59 PST
Ah agreed, we should be following step 3 of your proposal here ( http://wiki.ecmascript.org/doku.php?id=strawman:magic_proto_property ), this will still be a change from our previous behavior, but will be more restrictive rather than less. Thanks for the bug Mark!
Gavin Barraclough
Comment 4 2012-02-20 13:54:45 PST
I had to roll out bug#78409 to fix a couple of test cases, when I re-landed it I fixed this too. There is a test case covering this. All should hopefully be good now, cheers for the bug report. *** This bug has been marked as a duplicate of bug 78409 ***
Note You need to log in before you can comment on or make changes to this bug.