Modules: import *
erik.arvidsson at gmail.com
Thu Oct 31 10:40:59 PDT 2013
Thanks, that makes sense.
On Thu, Oct 31, 2013 at 1:22 PM, Jason Orendorff
<jason.orendorff at gmail.com>wrote:
> `import *` delays full knowledge of what's in the import lexical scope
> until link time. (That is, you can't figure out scopes by looking at
> a module in isolation. You have to wait for its dependencies.)
> import * from "stickers";
> y = r * Math.sin(a);
> It is unclear whether `Math` refers to the global Math or to something
> imported from "stickers" at least until "stickers" is loaded.
You have to wait for "stickers" to load to validate the imports anyway.
> Similarly, `export * from` delays full knowledge of what's exported
> until link time. The practical difference is that a compiler can
> benefit from having static scope information up front. Exports really
> are not needed until link time.
But it has a similar issue. You cannot look at a module in isolation and
know what it exports.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss