jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/361642 )
Change subject: Replace deprecated jQuery.isArray by Array.isArray
......................................................................
Replace deprecated jQuery.isArray by Array.isArray
jQuery.isArray gets deprecated in jQuery 3.2.0. [1]
Array.isArray is part of ES5 and MediaWiki 1.29+ which ensures that
JavaScript is only used when the browser supports ES5. (T128115)
Array.isArray is supported since the following browser versions: [2]
* Chrome 5
* Firefox (Gecko) 4.0 (2.0)
* Internet Explorer 9
* Opera 10.5
* Safari 5
Also change
new Array( ... )
to
[ ... ]
[1] https://blog.jquery.com/2017/03/16/jquery-3-2-0-is-out/
[2]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray#Browser_compatibility
Change-Id: If3e0d90649c5cfba66c36b258a906e5912ec6e6f
---
M modules/tools/ext.cx.tools.link.js
M modules/tools/ext.cx.tools.manager.js
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
jenkins-bot: Verified
Nikerabbit: Looks good to me, approved
diff --git a/modules/tools/ext.cx.tools.link.js
b/modules/tools/ext.cx.tools.link.js
index f2d0607..9bc502f 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -62,8 +62,8 @@
return deferred.resolve( {} ).promise();
}
- if ( !$.isArray( titles ) ) {
- titles = new Array( titles );
+ if ( !Array.isArray( titles ) ) {
+ titles = [ titles ];
}
if ( language === mw.cx.sourceLanguage ) {
diff --git a/modules/tools/ext.cx.tools.manager.js
b/modules/tools/ext.cx.tools.manager.js
index a517e1e..b36d819 100644
--- a/modules/tools/ext.cx.tools.manager.js
+++ b/modules/tools/ext.cx.tools.manager.js
@@ -150,7 +150,7 @@
this.$container.append( tool.getCard() );
if ( typeof data === 'string' ) {
- data = new Array( data );
+ data = [ data ];
}
this.$loadingIndicator.show();
--
To view, visit https://gerrit.wikimedia.org/r/361642
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If3e0d90649c5cfba66c36b258a906e5912ec6e6f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Fomafix <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits