Last modified: 2014-06-26 23:40:20 UTC
Right now we have roughly this: ----------------------------------- -- load.php?module=startup function isCompatible() { .. } function startUp() { ..mw.loader.register( ... ); } if ( isCompatible() ) { document.write( load.php?module=jquery|mediawiki ); } -- load.php?module=jquery|mediawiki * jquery.js * mediawiki.js - contains: if ( jQuery.isFunction( window.startUp ) ) { window.startUp(); } mw.loader.state({"jquery":"ready","mediawiki":"ready"}); ----------------------------------- Since the request for jquery/mediawiki is blocking, we can just put the contents of startUp() after the load without needing the function. This doesn't work right away though, due to the mw.loader.state() call. Because if that is called before the registry is created it will create null-modules with those names, causing an exception when the real registry is inserted.
"mw.loader.state" needs to be called only after a valid registry is loaded. But the registry is not necessarily loaded always as it is done through startUp function which is in an if condition (which is not necessarily true) So, either call the startup function always before the loader.state is invoked, or replace the startUp fuction definion with the body of that fucntion itself.
This is clearly not actually assigned.