https://bugzilla.wikimedia.org/show_bug.cgi?id=32537
Lupo <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #6 from Lupo <[email protected]> 2012-03-25 21:42:28 UTC --- Ran into this problem at the Commons now. Site module is loaded by default and does a mw.loader.state('site', 'ready') at the end. However, a gadget used mw.loader.using(['site, 'user'], ...) and got executed earlier. mw.loader.using didn't know about 'site' being in transit, and issued a second request. (Ditto for 'user'.) That second request even arrived and executed before the default request. Because it ran the site module in a closure, we indeed hit an "undefined variable exception" later on in the gadget. This particular error has been fixed by replacing a "var Foo = {...}" in the Commons' Common.js by "window.Foo = {...}", but still loading this module twice may have arbitrary side-effects. mw.loader.using really should special-case the default loaded modules "site", "user", "user.groups". It is evidently useful to be able to specify them as dependencies in mw.loader.using(), but we don't want to load them a second time. So why not simply adapt mw.loader to have the default-loaded modules pre-registered with a 'loading' state? -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
