New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14.1.12 Static Semantics: IsFunctionDefinition #536

Open
CountOrlok opened this Issue Apr 12, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@CountOrlok

CountOrlok commented Apr 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?

@GeorgNeis

This comment has been minimized.

Show comment
Hide comment
@GeorgNeis

GeorgNeis Jun 7, 2016

Contributor

I agree. (This also applies to classes and generator functions.)

Contributor

GeorgNeis commented Jun 7, 2016

I agree. (This also applies to classes and generator functions.)

@allenwb

This comment has been minimized.

Show comment
Hide comment
@allenwb

allenwb Jun 7, 2016

Member

Right, as noted in the original issue, this appears to be a regress from the original ES6. The bug also occurs in 14.4.9 and 14.5.8

Member

allenwb commented Jun 7, 2016

Right, as noted in the original issue, this appears to be a regress from the original ES6. The bug also occurs in 14.4.9 and 14.5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment