Ensure that null/undefined args don't choke on native indexOf

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
Rick Waldron 2012-12-21 15:24:42 -05:00
parent 1d0322f0b1
commit dcf94a58c7

View File

@ -587,7 +587,7 @@ jQuery.extend({
},
inArray: function( elem, arr, i ) {
return core_indexOf.call( arr, elem, i );
return arr == null ? -1 : core_indexOf.call( arr, elem, i );
},
merge: function( first, second ) {