ES6 spec: `export default` HoistableDeclaration

Axel Rauschmayer axel at
Wed Nov 19 13:59:07 PST 2014

>> * Do these grammar rules mean that you have to put anonymous function expressions in parentheses? Is that desirable (given that it’s a frequent use case)?
> No, HoistableDeclaration[Default] includes FunctionDeclaration that lacks a BindingIdentifier.

OK, I take it the following wasn’t viable?

> `export default` [lookahead ≠ `function (` ] HoistableDeclaration  
> `export default` AssignmentExpression `;`

>> * If the purpose of the first rule is to enable default-exporting of declarations (= no semicolon) – shouldn’t classes be included?
> It has nothing to do with semicolons. It's so a function that is a default export can also have a local name binding.

Ah, interesting and useful.

> We should also allow:
>    export default class Foo {};
> where Foo is a module local binding.

Without the semicolon, though? The “operand” of `export default` is also a declaration, right?

> Please file a bug.

Will do, once I fully understand the issue.

Dr. Axel Rauschmayer
axel at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list