Fixes #8814. Clean up inArray.
This commit is contained in:
parent
f182b7b921
commit
8c40c00fac
12
src/core.js
12
src/core.js
|
@ -658,8 +658,9 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
inArray: function( elem, array ) {
|
inArray: function( elem, array ) {
|
||||||
if ( array.indexOf ) {
|
|
||||||
return array.indexOf( elem );
|
if ( indexOf ) {
|
||||||
|
return indexOf.call( array, elem );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( var i = 0, length = array.length; i < length; i++ ) {
|
for ( var i = 0, length = array.length; i < length; i++ ) {
|
||||||
|
@ -843,12 +844,6 @@ if ( jQuery.browser.webkit ) {
|
||||||
jQuery.browser.safari = true;
|
jQuery.browser.safari = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( indexOf ) {
|
|
||||||
jQuery.inArray = function( elem, array ) {
|
|
||||||
return indexOf.call( array, elem );
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE doesn't match non-breaking spaces with \s
|
// IE doesn't match non-breaking spaces with \s
|
||||||
if ( rnotwhite.test( "\xA0" ) ) {
|
if ( rnotwhite.test( "\xA0" ) ) {
|
||||||
trimLeft = /^[\s\xA0]+/;
|
trimLeft = /^[\s\xA0]+/;
|
||||||
|
@ -898,3 +893,4 @@ function doScrollCheck() {
|
||||||
return jQuery;
|
return jQuery;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue