mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
parent
279913c71b
commit
10efa1f5b4
@ -216,7 +216,7 @@ jQuery.extend({
|
||||
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
||||
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
||||
// subtraction forces infinities to NaN
|
||||
return obj - parseFloat( obj ) >= 0;
|
||||
return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
|
||||
},
|
||||
|
||||
isPlainObject: function( obj ) {
|
||||
|
@ -457,7 +457,7 @@ test("isFunction", function() {
|
||||
});
|
||||
|
||||
test( "isNumeric", function() {
|
||||
expect( 36 );
|
||||
expect( 38 );
|
||||
|
||||
var t = jQuery.isNumeric,
|
||||
Traditionalists = /** @constructor */ function(n) {
|
||||
@ -505,6 +505,8 @@ test( "isNumeric", function() {
|
||||
equal( t(Number.NEGATIVE_INFINITY), false, "Negative Infinity");
|
||||
equal( t(rong), false, "Custom .toString returning non-number");
|
||||
equal( t({}), false, "Empty object");
|
||||
equal( t( [] ), false, "Empty array" );
|
||||
equal( t( [ 42 ] ), false, "Array with one number" );
|
||||
equal( t(function(){} ), false, "Instance of a function");
|
||||
equal( t( new Date() ), false, "Instance of a Date");
|
||||
equal( t(function(){} ), false, "Instance of a function");
|
||||
|
Loading…
Reference in New Issue
Block a user