mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Unit test for this case
Codestyle fixes
This commit is contained in:
parent
9c18eb2c15
commit
190136cf61
@ -678,8 +678,7 @@ jQuery.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
inArray: function( elem, array ) {
|
inArray: function( elem, array ) {
|
||||||
if (!jQuery.isArray(array))
|
if ( !array ) {
|
||||||
{
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -916,6 +916,16 @@ test("jQuery.makeArray", function(){
|
|||||||
same( jQuery.makeArray({length: "5"}), [], "Make sure object is coerced properly.");
|
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(){
|
test("jQuery.isEmptyObject", function(){
|
||||||
expect(2);
|
expect(2);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user