On Nov 19, 2014 6:54 AM, Axel Rauschmayer <[email protected]> wrote:
>
> Quoting https://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports
>
> > `export default` HoistableDeclaration

Note that the actual spec. text has a [Default] grammar parameter after 
HoistableDeclaration. That,'s important.

> > `export default` [lookahead ≠ `function`] AssignmentExpression `;`
>
> Questions:
>
> * 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.

> * 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.

We should also allow:
   export default class Foo {};

where Foo is a module local binding.

Please file a bug.

Allen
>
> Thanks!
>
> Axel
>
> -- 
> Dr. Axel Rauschmayer
> [email protected]
> rauschma.de
>
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to