diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2011-04-10 14:31:31 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-04-10 14:31:31 -0400 |
commit | 8c40c00fac2f30fa0804ae8097642636f9718ddd (patch) | |
tree | e4e38626f926fd58893cc456ebbe8efc563ede89 /src/core.js | |
parent | f182b7b92117f8e353a1f712569d3d2642100862 (diff) | |
download | jquery-8c40c00fac2f30fa0804ae8097642636f9718ddd.tar.gz jquery-8c40c00fac2f30fa0804ae8097642636f9718ddd.zip |
Fixes #8814. Clean up inArray.
Diffstat (limited to 'src/core.js')
-rw-r--r-- | src/core.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core.js b/src/core.js index 3331969a3..b05d4138c 100644 --- a/src/core.js +++ b/src/core.js @@ -658,8 +658,9 @@ jQuery.extend({ }, 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++ ) { @@ -843,12 +844,6 @@ if ( jQuery.browser.webkit ) { 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 if ( rnotwhite.test( "\xA0" ) ) { trimLeft = /^[\s\xA0]+/; @@ -898,3 +893,4 @@ function doScrollCheck() { return jQuery; })(); + |