Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/190366
Change subject: Use $.isArray instead of Array.isArray
......................................................................
Use $.isArray instead of Array.isArray
This improves compatibility with older browsers (IE<9).
Change-Id: I4597030c6f6fa30302e4a470d4370e3741d870df
---
M lib/oojs.jquery.js
M src/ActionSet.js
M src/core.js
3 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/66/190366/1
diff --git a/lib/oojs.jquery.js b/lib/oojs.jquery.js
index 0b61721..7758fc3 100644
--- a/lib/oojs.jquery.js
+++ b/lib/oojs.jquery.js
@@ -348,7 +348,7 @@
}
}
- if ( Array.isArray( source ) ) {
+ if ( $.isArray( source ) ) {
// Array (fall through)
destination = new Array( source.length );
} else if ( source && typeof source.clone === 'function' ) {
@@ -412,7 +412,7 @@
// This object has its own custom hash function, use it
val = val.getHashObject();
}
- if ( !Array.isArray( val ) && Object( val ) === val ) {
+ if ( !$.isArray( val ) && Object( val ) === val ) {
// Only normalize objects when the key-order is ambiguous
// (e.g. any object not an array).
normalized = {};
@@ -730,7 +730,7 @@
for ( event in methods ) {
method = methods[event];
// Allow providing additional args
- if ( Array.isArray( method ) ) {
+ if ( $.isArray( method ) ) {
args = method.slice( 1 );
method = method[0];
} else {
@@ -824,7 +824,7 @@
if ( typeof name === 'string' ) {
this.registry[name] = data;
this.emit( 'register', name, data );
- } else if ( Array.isArray( name ) ) {
+ } else if ( $.isArray( name ) ) {
for ( i = 0, len = name.length; i < len; i++ ) {
this.register( name[i], data );
}
diff --git a/src/ActionSet.js b/src/ActionSet.js
index 7feac3a..e17502d 100644
--- a/src/ActionSet.js
+++ b/src/ActionSet.js
@@ -128,12 +128,12 @@
for ( category in this.categorized ) {
list = filters[ category ];
if ( list ) {
- if ( !Array.isArray( list ) ) {
+ if ( !$.isArray( list ) ) {
list = [ list ];
}
for ( i = 0, len = list.length; i < len; i++ ) {
actions = this.categorized[ category ][
list[ i ] ];
- if ( Array.isArray( actions ) ) {
+ if ( $.isArray( actions ) ) {
matches.push.apply( matches,
actions );
}
}
@@ -374,7 +374,7 @@
this.categorized[ category ] =
{};
}
list = action[ this.categories[
category ] ]();
- if ( !Array.isArray( list ) ) {
+ if ( !$.isArray( list ) ) {
list = [ list ];
}
for ( j = 0, jLen = list.length; j <
jLen; j++ ) {
diff --git a/src/core.js b/src/core.js
index 947a23d..9a2f318 100644
--- a/src/core.js
+++ b/src/core.js
@@ -92,7 +92,7 @@
*/
OO.ui.contains = function ( containers, contained, matchContainers ) {
var i;
- if ( !Array.isArray( containers ) ) {
+ if ( !$.isArray( containers ) ) {
containers = [ containers ];
}
for ( i = containers.length - 1; i >= 0; i-- ) {
--
To view, visit https://gerrit.wikimedia.org/r/190366
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4597030c6f6fa30302e4a470d4370e3741d870df
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits