TC39 vs "the community"

Juan Ignacio Dopazo jdopazo at yahoo-inc.com
Fri Jun 20 16:11:39 PDT 2014





On Friday, June 20, 2014 7:15 PM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:
 
typo ...

```
var require = function (fromWhere) {
  return  import * from fromWhere
};
```

That's not valid ES6. It's specified that:

- Import and export statements can only be top level statements
- The module name must be a string literal.
- Import * is not specified.

ES6 modules are designed to be static. So no, you can't use import statements under the hood in require(). But you can set up things so that you can use "import" to import CommonJS modules.

Juan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140620/c69a0772/attachment-0001.html>


More information about the es-discuss mailing list