From 4626e7ddb14e680e3d35e0ac6bd436e1f18a68a3 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Fri, 23 Jun 2017 08:45:29 +0200 Subject: [PATCH] Use $.noop instead of function () {} $.noop (https://api.jquery.com/jQuery.noop/) already provides an empty function. Change-Id: I7f1ca20a894d0469cb7bcb72c81722070e040956 --- .../src/mediawiki.special/mediawiki.special.apisandbox.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js index 73c3c450c7..694f86ae14 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js @@ -1415,8 +1415,7 @@ if ( $.isFunction( f.focus ) ) { f.focus(); } - }, - doNothing = function () {}; + }; // This is something of a hack. We always want the 'format' and // 'action' parameters from the main module to be specified, @@ -1642,7 +1641,7 @@ // it makes it too hard to read and our "disabled" // isn't really disabled. widgetField.onFieldDisable( false ); - widgetField.onFieldDisable = doNothing; + widgetField.onFieldDisable = $.noop; if ( Util.apiBool( pi.parameters[ i ].deprecated ) ) { deprecatedItems.push( widgetField, helpField ); -- 2.20.1