diff options
author | Manoj Kumar <nithmanoj@gmail.com> | 2016-08-14 10:54:16 +0000 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2016-11-30 12:22:24 +0100 |
commit | 1b9575b9d14399e9426b9eacdd92b3717846c3f2 (patch) | |
tree | cb0991e1c7eda7b3b496f52d09b361e8e6425016 /src | |
parent | 5b4cb0d33731a58384e02ad51e703e7dcb00e424 (diff) | |
download | jquery-1b9575b9d14399e9426b9eacdd92b3717846c3f2.tar.gz jquery-1b9575b9d14399e9426b9eacdd92b3717846c3f2.zip |
Core: Deprecate jQuery.isArray
Fixes gh-2961
Closes gh-3278
Diffstat (limited to 'src')
-rw-r--r-- | src/attributes/val.js | 4 | ||||
-rw-r--r-- | src/core.js | 6 | ||||
-rw-r--r-- | src/css.js | 2 | ||||
-rw-r--r-- | src/data/Data.js | 2 | ||||
-rw-r--r-- | src/deprecated.js | 1 | ||||
-rw-r--r-- | src/effects.js | 2 | ||||
-rw-r--r-- | src/queue.js | 2 | ||||
-rw-r--r-- | src/serialize.js | 6 |
8 files changed, 12 insertions, 13 deletions
diff --git a/src/attributes/val.js b/src/attributes/val.js index fbf406929..9245e4e0a 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -62,7 +62,7 @@ jQuery.fn.extend( { } else if ( typeof val === "number" ) { val += ""; - } else if ( jQuery.isArray( val ) ) { + } else if ( Array.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; } ); @@ -173,7 +173,7 @@ jQuery.extend( { jQuery.each( [ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { + if ( Array.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); } } diff --git a/src/core.js b/src/core.js index f3983b4a8..c99f27e22 100644 --- a/src/core.js +++ b/src/core.js @@ -172,11 +172,11 @@ jQuery.extend = jQuery.fn.extend = function() { // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + ( copyIsArray = Array.isArray( copy ) ) ) ) { if ( copyIsArray ) { copyIsArray = false; - clone = src && jQuery.isArray( src ) ? src : []; + clone = src && Array.isArray( src ) ? src : []; } else { clone = src && jQuery.isPlainObject( src ) ? src : {}; @@ -215,8 +215,6 @@ jQuery.extend( { return jQuery.type( obj ) === "function"; }, - isArray: Array.isArray, - isWindow: function( obj ) { return obj != null && obj === obj.window; }, diff --git a/src/css.js b/src/css.js index 5e4451193..c17265ced 100644 --- a/src/css.js +++ b/src/css.js @@ -404,7 +404,7 @@ jQuery.fn.extend( { map = {}, i = 0; - if ( jQuery.isArray( name ) ) { + if ( Array.isArray( name ) ) { styles = getStyles( elem ); len = name.length; diff --git a/src/data/Data.js b/src/data/Data.js index 43ae01623..8c856c039 100644 --- a/src/data/Data.js +++ b/src/data/Data.js @@ -115,7 +115,7 @@ Data.prototype = { if ( key !== undefined ) { // Support array or space separated string of keys - if ( jQuery.isArray( key ) ) { + if ( Array.isArray( key ) ) { // If key is an array of keys... // We always set camelCase keys, so remove that. diff --git a/src/deprecated.js b/src/deprecated.js index 9fcc6b7da..0329b9564 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -25,6 +25,7 @@ jQuery.fn.extend( { } } ); +jQuery.isArray = Array.isArray; jQuery.parseJSON = JSON.parse; } ); diff --git a/src/effects.js b/src/effects.js index 68af96c61..4823659c2 100644 --- a/src/effects.js +++ b/src/effects.js @@ -256,7 +256,7 @@ function propFilter( props, specialEasing ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; - if ( jQuery.isArray( value ) ) { + if ( Array.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } diff --git a/src/queue.js b/src/queue.js index 3a626a2fc..fbbbeab71 100644 --- a/src/queue.js +++ b/src/queue.js @@ -17,7 +17,7 @@ jQuery.extend( { // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { + if ( !queue || Array.isArray( data ) ) { queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); diff --git a/src/serialize.js b/src/serialize.js index 35dcf04f9..2e28ce1e0 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -17,7 +17,7 @@ var function buildParams( prefix, obj, traditional, add ) { var name; - if ( jQuery.isArray( obj ) ) { + if ( Array.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { @@ -69,7 +69,7 @@ jQuery.param = function( a, traditional ) { }; // If an array was passed in, assume that it is an array of form elements. - if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { @@ -115,7 +115,7 @@ jQuery.fn.extend( { return null; } - if ( jQuery.isArray( val ) ) { + if ( Array.isArray( val ) ) { return jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ); |