On Tue, Jul 3, 2012 at 2:29 AM, Aymeric Vitte <[email protected]>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
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

