On Nov 19, 2014, at 1:59 PM, Axel Rauschmayer <[email protected]> wrote:
>>> * 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?
that’s correct. We wanted the initialization of a function like:
export default function () {}
to be hoisted, just like:
export function f() {};
>
> > `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.
anything that has an AssignmentExpression as its trailing grammar element needs
to end with a semicolon.
>
> 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?
right, ClassDeclaration doesn’t need to end of a semicolon.
>
>> Please file a bug.
>
> Will do, once I fully understand the issue.
>
> --
> Dr. Axel Rauschmayer
> [email protected]
> rauschma.de
>
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss