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 upis `export default function l() {}` syntactically valid? #750
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
As mentioned on Babel's Slack, the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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 |
icefapper commentedDec 8, 2016
Hello
judging from the spec, function declarations following an
export defaultcan not have names. At least I was unable to deriveexport 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?