Dynamically changing of loader global

David Bruant bruant.d at gmail.com
Mon Dec 24 14:34:33 PST 2012


Hi,

I've reading the loader API [1] and I was wondering if it was possible 
to dynamically change the global. I think it is by doing the following, 
but tell me if I'm wrong:

     const options = {
         global : {
             changeGlobal: function(g){
                 options.global = g;
             }
         }
     }

     var l = new Loader(Loader, options);

     l.eval('changeGlobal({a:37}); console.log(a);');

In other words, in the global in the loader the initial or the dynamic 
value of the "global" option?
If it was the dynamic value, I think it would help a lot in the 
document.open situation [2]

David

[1] http://wiki.ecmascript.org/doku.php?id=harmony:module_loaders#loader_api
[2] http://lists.w3.org/Archives/Public/www-dom/2012OctDec/0166.html


More information about the es-discuss mailing list