Why is "export default var a = 1;" invalid syntax?

Kevin Smith zenparsing at gmail.com
Tue Dec 16 06:18:00 PST 2014


>
> It does both.  'a' is rebound to 2 and since the export name 'default'
> associates to 'a', any subsequent references in other modules tht are
> linked to the default export of this module will also see 2 because
> 'default' is really just the export name for 'a'.
>

Ah - got it.  That makes sense.

I still agree with Dave and Brendan:  it would have been more clear if the
expression form `export default AssignmentExpression` had the "=" in there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141216/2608a7ec/attachment.html>


More information about the es-discuss mailing list