-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ExportDeclaration
and semicolons/ASI
#284
Comments
This was referenced Jan 13, 2016
Yes, the grammar is correct. I suggest rewriting the first sentence of https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion to be:
and yes, remove the two semicolon in Table 43 on the function exports. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion explicitly mentions
export
statements:Furthermore, table 43 (although purely illustrative) includes the semicolons in all of its examples: https://tc39.github.io/ecma262/#table-42
However, the
ExportDeclaration
grammar doesn’t include the semicolon for the following cases:export HoistableDeclaration
, e.g.export function foo() {}
export ClassDeclaration
, e.g.export class Bar {}
export default HoistableDeclaration
, e.g.export default function baz() {}
export default ClassDeclaration
, e.g.export default class Qux {}
If the grammar is correct, then:
export
since it’s currently overgeneralizingexport default function f(){}
andexport default function(){}
cc @jmm
The text was updated successfully, but these errors were encountered: