Static Module Resolution

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

On Tue, Jul 3, 2012 at 2:29 AM, Aymeric Vitte <vitteaymeric at>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
> ? <>

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.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list