mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Merge pull request #465 from anton-ryzhov/master
Fixes #10076. $.inArray crashes IE6 and Chrome if second argument is `null` or `undefined` (Thanks anton-ryzhov!)
This commit is contained in:
@@ -934,6 +934,16 @@ test("jQuery.makeArray", function(){
|
||||
same( jQuery.makeArray({length: "5"}), [], "Make sure object is coerced properly.");
|
||||
});
|
||||
|
||||
test("jQuery.inArray", function(){
|
||||
expect(3);
|
||||
|
||||
equals( jQuery.inArray( 0, false ), -1 , "Search in 'false' as array returns -1 and doesn't throw exception" );
|
||||
|
||||
equals( jQuery.inArray( 0, null ), -1 , "Search in 'null' as array returns -1 and doesn't throw exception" );
|
||||
|
||||
equals( jQuery.inArray( 0, undefined ), -1 , "Search in 'undefined' as array returns -1 and doesn't throw exception" );
|
||||
});
|
||||
|
||||
test("jQuery.isEmptyObject", function(){
|
||||
expect(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user