]> source.dussan.org Git - jquery.git/commitdiff
$.inArray doesn't crush IE6 and Chrome if second argument is `null` or `undefined`
authorAnton Ryzhov <anton@ryzhov.me>
Wed, 17 Aug 2011 11:30:12 +0000 (15:30 +0400)
committerAnton Ryzhov <anton@ryzhov.me>
Wed, 17 Aug 2011 11:30:12 +0000 (15:30 +0400)
src/core.js

index 7a77ae13270a2ee1a3ac3a0a597c821f013a26be..db832a0bf21091f93bf681f00df74104892e6971 100644 (file)
@@ -678,6 +678,10 @@ jQuery.extend({
        },
 
        inArray: function( elem, array ) {
+               if (!jQuery.isArray(array))
+               {
+                       return -1;
+               }
 
                if ( indexOf ) {
                        return indexOf.call( array, elem );