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

Dave Herman dherman at mozilla.com
Mon Dec 15 08:16:39 PST 2014


On Mon, Dec 15, 2014 at 8:01 AM, Marius Gundersen <gundersen at gmail.com>
wrote:

> So are all of these legal?
> ```js
> var a = 1; // legal
> export a; // legal
>
> var b = 1; // legal
> export default b; // legal
>
> export var c = 1; // legal
> export var d = 1, e = 2, f = 3; // legal
> ```
> What about:
> ```js
> var default = 1; // illegal: invalid identifier
> export default; // illegal: missing initializer expression for default
> export
>
> var b = 1; // legal
> export default b; // legal
> ```
> Sorry for not being very good at reading EBNF
>

Hey, who is? ;P

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141215/a0a69b60/attachment.html>


More information about the es-discuss mailing list