On Oct 19, 2014, at 1:04 PM, Rick Waldron wrote:

> 
> 
> On Sun, Oct 19, 2014 at 1:59 PM, Erik Arvidsson <[email protected]> 
> wrote:
> A file that is imported is treated as a module. That's it.
> 
> And you can statically infer that a file is module by reading the source and 
> scanning for `export`, which would also mean it's a module. This wouldn't 
> catch files that don't have an `export` that are still imported from some 
> other file.
> 
As file as simple (or even simpler) as:
var x;
//---eof------

can be a module. Neither import or export is required in a module.  A module is 
anything that is parsed by the ES implementation using the Module grammar 
production as its goal symbol.

It is implementation dependent how it is determined whether an individual file 
will be parsed as a Script or as a Module. 

Axel alluded to a possible HTML extension that could be used to distinguish 
modules from scripts.  But, exactly how modules will be integrated into HTML is 
still under development.

You can imagine various ways that modules might be identified in a command line 
environment. for example

js script1.js -m mod1.js -m mod2.js script2.js

so of us have argued that a module file extension might be useful in such 
environments:

js script1.js mod1.js mod2.js script2.js

Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to