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

is `export default function l() {}` syntactically valid? #750

Closed
icefapper opened this Issue Dec 8, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@icefapper

icefapper commented Dec 8, 2016

Hello
judging from the spec, function declarations following an export default can not have names. At least I was unable to derive export default function l() {} from the relevant rules outlined in ES2015 and ES2017 specs.
I am also rather confused by the fact that Table 43 in ES2017 actually uses such construct.

is it a spec bug? or am I only missing something?

@loganfsmyth

This comment has been minimized.

Show comment
Hide comment
@loganfsmyth

loganfsmyth Dec 8, 2016

Contributor

As mentioned on Babel's Slack, the [+Default] in the FunctionDeclaration rule is additional syntax for that specific case, but it does not replace the normal function declaration syntax with a name, which still applies when export default is in use.

Contributor

loganfsmyth commented Dec 8, 2016

As mentioned on Babel's Slack, the [+Default] in the FunctionDeclaration rule is additional syntax for that specific case, but it does not replace the normal function declaration syntax with a name, which still applies when export default is in use.

@icefapper

This comment has been minimized.

Show comment
Hide comment
@icefapper

icefapper Dec 8, 2016

looks like I've missed the fact that the + next to a rule means 'also', not 'only'

icefapper commented Dec 8, 2016

looks like I've missed the fact that the + next to a rule means 'also', not 'only'

@icefapper icefapper closed this Dec 8, 2016

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