Static Module Resolution

Jason Orendorff jason.orendorff at gmail.com
Tue Jul 3 12:06:50 PDT 2012


On Tue, Jul 3, 2012 at 2:29 AM, Aymeric Vitte <vitteaymeric at gmail.com>wrote:

> why can't we have in the module proposal (or somewhere) just the
> possibility to load code and eval it (in browsers and server side
> environments) ? ie why should I be obliged to transform my script into a
> module and have to maintain both, or more if I want to insure perfect
> compatibility ? The question is trivial and not entirely related to modules
> or ES but since modules are considered, why not adding this possibility now
> ? <https://mail.mozilla.org/listinfo/es-discuss>
>

Well, under the current proposal, you can say:
  System.load(url, function () {}, function () {});

This will basically just load the given url and run it, asynchronously.
(The code is treated as a module, but IIUC the only difference that makes
is that global variables and functions it defines won't pollute the global
environment by default -- which seems like a good thing.)

-j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120703/878f0f0e/attachment.html>


More information about the es-discuss mailing list