Dynamically changing of loader global

David Bruant bruant.d at gmail.com
Wed Dec 26 01:57:33 PST 2012


Le 25/12/2012 23:01, Brandon Benvie a écrit :
> I updated my Loader implementation to allow dynamically modifying the 
> options since it seems like a potentially good idea worth 
> investigating, and also seems like it might be indicated as the 
> desired functionality based on global and baseURL being specified as 
> getters.
That's what I thought too, though a getter may just be for better 
syntax. A "getGlobal" method would be of bad taste in a post-ES5 world.

> In order to make this work requires storing a reference to the parent 
> as well in order to keep the spirit of deferring to the parent when 
> the loader's options don't specify a global. You can see this in 
> action here 
> https://github.com/Benvie/continuum/blob/gh-pages/engine/builtins/%40system.js#L63. 
>
>
> For good measure I made this work with most of the options, not just 
> loader and baseURL (the three callbacks).
Really cool, thanks :-)

On a related note, I had misunderstood document.open on the www-dom 
thread, so what I suggested here can't be a solution, I think. However, 
I'm glad it caught your attention enough to think it's a valuable idea :-)

David


More information about the es-discuss mailing list