From: Timo Tijhof Date: Fri, 28 Aug 2015 23:12:07 +0000 (+0200) Subject: resourceloader: Remove redundant type-checks in internal code X-Git-Tag: 1.31.0-rc.0~10191 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=158f4cd6cceaf06b6cbd5845337840f24fdd0f7f;p=lhc%2Fweb%2Fwiklou.git resourceloader: Remove redundant type-checks in internal code The private 'execute()' method only runs for modules that have been implemented by mw.loader.implement, which already throws if 'messages' or 'style' is set to a non-object value. The execute() code for 'templates' already has this check removed. Change-Id: I65b8a87500388d3d2ca6e495e1e50179639ba27a --- diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 2632902a25..2621a97dba 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -1245,7 +1245,7 @@ registry[module].state = 'loading'; // Add localizations to message system - if ( $.isPlainObject( registry[module].messages ) ) { + if ( registry[module].messages ) { mw.messages.set( registry[module].messages ); } @@ -1283,7 +1283,7 @@ // * back-compat: { : [url, ..] } // * { "css": [css, ..] } // * { "url": { : [url, ..] } } - if ( $.isPlainObject( registry[module].style ) ) { + if ( registry[module].style ) { for ( key in registry[module].style ) { value = registry[module].style[key]; media = undefined;