A few more questions about the current module proposal
jussi.kalliokoski at gmail.com
Wed Jul 4 09:29:23 PDT 2012
Hello, good people,
I fear I have some misunderstanding going on with the current module
proposal, as well as outright ignorance, hence I'd like to get answers to a
few questions, as I'm pretty sure I'm not the only one. :)
1) How does the static resolution and static scoping behave when out of the
normal context. As an example if `import` is in an `eval()` call, what
var code = loadFromURL('http://example.org/foo.js') // content: `import foo
console.log(foo) // ???
Would this example block until the module is resolved and loaded? Would it
throw? What happens, exactly? As my $0.02 goes, I think it's a bad idea to
ban import in eval.
2) How does the module proposal address the increasing need for interaction
between pure JS and compile-to-JS languages? (CoffeeScript, Haxe, JS++,
More specifically, can you add hooks to preprocessing the files? If not,
why? I think it would break static module resolution, but are we certain
that static module resolution is worth the price of excluding JS
preprocessors of the module system (aside from server-side preprocessing
that is)? Again, my personal opinion is that including compile-to-JS
languages in the module system would be worth much more than static
resolution, but feel free to enlighten me.
I'm sorry if these questions have been answered already, I'm trying to keep
up with the discussion, but there's always something I'll miss/overlook I
guess. I'll probably have more questions after these are answered but bare
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss