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
Function code is source text that is parsed to supply the value of the [[ECMAScriptCode]] and [[FormalParameters]] internal slots (see 9.2) of an ECMAScript function object.
While the formal parameters are part of the function code, the declaration name however is not.
The text was updated successfully, but these errors were encountered:
@bakkot Confirmed. I checked the behavior of V8, SpiderMonkey, and ChakraCore.
It would be interesting to find out (1) the reason that most web browser's engine continues to violate the specification (compatibility etc) and (2) if there is any plan for those engines to start to comply to the specification in the future.
The spec question has finally been resolved in favor of making a normative change to match the behavior in most implementations, including esprima. See tc39/ecma262#1158. I think this can be closed with no further action.
(As reported by @michaelficarra and explained by @bakkot as case 14,15,18-25 in #1502).
Test case:
Actual: An exception "Function name may not be eval or arguments in strict mode".
Expected: A valid syntax tree.
A similar test case:
Actual: An exception "Use of future reserved word in strict mode".
Expected: A valid syntax tree.
A reference for this in the specification is on Types of Source Code:
While the formal parameters are part of the function code, the declaration name however is not.
The text was updated successfully, but these errors were encountered: