Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up14.1.12 Static Semantics: IsFunctionDefinition #536
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
I agree. (This also applies to classes and generator functions.) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
allenwb
added
the
spec bug
label
Jun 7, 2016
anba
referenced this issue
Mar 21, 2018
Open
Missing IsFunctionDefinition for anonymous FunctionExpression #1139
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CountOrlok commentedApr 12, 2016
I think there is something missing in IsFunctionDefinition at 14.1.12. The operation as described here will only return true if the given production is a named function definition, but false for anonymous function definitions.
Therefore when calling IsAnonymousFunctionDefinition with argument production, the first algorithm step would always return false for anonymous function expressions and the operation HasName would be unreachable.
So it rather should be:
14.1.12 Static Semantics: IsFunctionDefinition
FunctionExpression: function (FormalParameters) {FunctionBody}
FunctionExpression: function BindingIdentifier (FormalParameters) {FunctionBody}
Return true.
[as in ES2015: IsFunctionDefiniton]
Or is there a reason for changing this?