I would really encourage you to read the spec grammar.
> ```js
> export foo();
> ```
This is not allowed by the grammar; there is no form `export <expression>`
> ```js
> export default let a = [thing1, thing2];
> ```
This is not allowed by the grammar; `let a = [thing1, thing2]` is not an
AssignmentExpression.
> ```js
> let app = module.exports = require('express')();
> ```
Try
```js
import express from "express";
let app = express();
export default app;
```
From: Calvin Metcalf [mailto:[email protected]]
Sent: Wednesday, January 29, 2014 21:46
To: Jason Orendorff
Cc: Domenic Denicola; Erik Arvidsson; EcmaScript
Subject: Re: restrictions on module import export names
ok so would this be accurate https://gist.github.com/calvinmetcalf/8701624 ?
the syntax does make it impossible to write something equivalent to
```js
let app = module.exports = require('express')();
```
On Wed, Jan 29, 2014 at 6:40 PM, Jason Orendorff <[email protected]>
wrote:
On Wed, Jan 29, 2014 at 3:39 PM, Calvin Metcalf
<[email protected]> wrote:
> *would be equivalent of it was allowed
>
>[...]
>> So the following are equivalent?
>>
>> ```js
>> export default foo();
>> export let default = foo();
>> ```
Yes.
-j
--
-Calvin W. Metcalf
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss