Modules loader define method

Erik Arvidsson erik.arvidsson at gmail.com
Thu Oct 31 07:10:34 PDT 2013


I see that Jason added a Loader.prototype.define to his reference
implementation.
https://people.mozilla.org/~jorendorff/js-loaders/Loader.html#section-177.
This is great. It is a much needed capability to allow bundling modules
into a single file.

It allows you to do something like

System.define(['url-a', urlB], ['export var a = "a";', moduleBodyForUrlB]);

However, this is just another form of eval and will therefore not be
available in CSP. Can we come up with something that works in CSP
environments? How about?

module 'url-a' {
  export var a = "a";
}

=P

-- 
erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131031/fc470ab8/attachment.html>


More information about the es-discuss mailing list