You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that S5 does not conform to ES5.1, Section 8.7.2 PutValue (V, W), [[Put]], Step 7.a.
For the following test program:
// 8.7.2 PutValue (V, W), [[Put]], Step 7.a
// 7. Else, this is a request to create an own property on the transient object O
// a. If Throw is true, then throw a TypeError exception.
// For [[Put]] for a reference with a primitive base,
// if it does not have its own value, but a inherited data descriptor,
// then this assignment will create its own data descriptor which cannot be used later at all, because this object will immediately disappear after this assignment
// (at least there is no reference pointing to this object, so it's not accessible).
// Thus, if throw is true, then it throws TypeError.
"use strict";
try {
1["x"] = 10; // TypeError
throw "Not here!";
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('"use strict"; Object.defineProperty(Number.prototype, "x", { "value" : 0, "writable" : false, "enumerable" : true, "configurable" : true }); 1["x"] = 10; throws TypeError. Actual: ' + e);
}
}
S5 throws an exception, while it should have succeeded:
Again, the error reported by S5 in the output you gave is that $ERROR is undefined. The smaller test from the bug report:
"use strict";
"s".x = 3;
Does seem to succeed without an error, when strict mode says it shouldn't. I see that Chrome has the spec'ed behavior (throwing an error), while Firefox has the bug. Thanks!
It seems to me that S5 does not conform to ES5.1, Section 8.7.2 PutValue (V, W), [[Put]], Step 7.a.
For the following test program:
S5 throws an exception, while it should have succeeded:
Is there anything that I'm missing?
The text was updated successfully, but these errors were encountered: