Module Default Export Syntax

Kevin Smith zenparsing at gmail.com
Sat Jun 21 21:44:00 PDT 2014


>
>
>     export default { a: a1, b: b1 };
>
>
To expand a bit:  these two export declarations are both valid:

    export { a, b, c };
    export default { a, b, c };

They differ only in the presence of a keyword, yet they are have completely
different semantics.

So let me propose an alternative to the current syntax that might be
acceptable to everyone:

    ExportDeclaration:
        ...
        export default ClassDeclaration
        export default FunctionDeclaration
        export default GeneratorDeclaration
        export default = AssignmentExpression

Thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140622/86b79b96/attachment.html>


More information about the es-discuss mailing list