User "Trevor Parscal" changed the status of MediaWiki.r96964.

Old Status: new
New Status: ok

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96964
Commit summary:

Address one of the fixmes on r88053: because addScript() is asynchronous, 
calling it repeatedly can lead to scripts loading out of order. The specific 
bug was that if you had a module with two script files, A and B (in that order; 
scripts are always loaded in the order in which they are specified for 
multi-file modules) and A is 40M while B is 1K, then B would be executed before 
A if the module is loaded after document ready (through e.g. mw.loader.using) 
and the files are not in the browser cache.

So instead of calling addScript() repeatedly in a loop, this commit calls 
addScript() recursively from its own callback, using a helper function called 
nestedAddScript(). This also means the if block that checks if the scripts 
array is empty can be removed, because nestedAddScript() handles empty arrays 
correctly.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to