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 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4, if-condition is true.
For the following test program:
// 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4, if-condition is true
// 4. Else this must be an attempt to change the value of an immutable binding so if S if true throw a TypeError exception.
// In a strict mode, assigning an immutable binding throws TypeError.
// There are only two ways to create an immutable binding:
// 1. 'arguments' is an immutable binding in a strict mode function.
// 2. name of a recursive function expression (it should be a function 'expression', not a function 'declaration') is an immutable binding of the function body's environment.
// In the first case, assigning such binding raises a syntax error, in advance, in a strict mode code, thus it cannot reach here.
// Thus, assigning the second kind of binding is the only case that can reach here, and the below example represents this case.
// In the example below, 'g' is a name of recursive function expression, thus inside the function body, 'g' is a immutable binding.
// Note that 'g' is not visible outside of the function body, that is, it is not visible in a global scope.
"use strict";
var f = function g() {
g = 0;
};
try {
f(); // TypeError
throw "Not here!";
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('"use strict"; var f = function g() { g = 0; }; f(); throws TypeError. Actual: ' + e);
}
}
S5 throws an exception, while it should have succeeded:
The text was updated successfully, but these errors were encountered:
daejunpark
changed the title
Failed to conform to ES5.1, Section 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4, if-condition is true
Failed to conform to ES5.1, Section 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4
Apr 7, 2015
In this example, I think that some support code is missing. S5 is reporting that $ERROR is unbound, so maybe this was part of the test infrastructure that's missing?
The program on the WebKit page
(function f() { f = 123; })()
does indeed produce undefined rather than an error though, so I think there's something to investigate in S5 here. Thanks!
It seems to me that S5 does not conform to ES5.1, Section 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4, if-condition is true.
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: