From 62308668c3445853e4d87b898d90becd15b2af7b Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Sat, 2 Mar 2013 00:03:19 -0500 Subject: [PATCH] mw.loader: Prevent useless jobs from being added to queue * load was calling request with ready and error being null. * request was doing a strict check against undefined to prevent adding jobs with no callbacks to the queue. * Since these were null rather than undefined, the empty jobs got added anyway. Now using undefined instead. * Mark ready and error as optional in the request JS documentation. Change-Id: I6428e733899f7c484f842f6fe142c8d4d49ee443 --- resources/mediawiki/mediawiki.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index b5b42e1b8e..1212fd4c2e 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -970,8 +970,8 @@ var mw = ( function ( $, undefined ) { * * @private * @param {string|string[]} dependencies Module name or array of string module names - * @param {Function} ready Callback to execute when all dependencies are ready - * @param {Function} error Callback to execute when any dependency fails + * @param {Function} [ready] Callback to execute when all dependencies are ready + * @param {Function} [error] Callback to execute when any dependency fails * @param {boolean} [async] If true, load modules asynchronously even if * document ready has not yet occurred. */ @@ -1447,7 +1447,7 @@ var mw = ( function ( $, undefined ) { return; } // Since some modules are not yet ready, queue up a request. - request( filtered, null, null, async ); + request( filtered, undefined, undefined, async ); }, /** -- 2.20.1