http://github.com/jquery/jquery/commit/c2bbcd88335cf6f8df4ac9389ecbae90291377fb
contains this version of isObject (changed by me to work as a stand-
alone ) :
isObject = function( obj )
{
if ( Object.prototype.toString.call(obj) !== "[object Object]" ) {
return false;
}
//own properties are iterated firstly,
//so to speed up, we can test last one if it is own or not
var key;
for ( key in obj ) {}
return !key || Object.prototype.hasOwnProperty.call( obj, key );
}
isObject( new Error() )
/*
false
*/
isObject( new String() )
/*
false
*/
isObject( new Date() )
/*
false
*/
isObject( new Object() )
/*
true
*/
isObject( alert )
/*
true
*/
It seems it has to be renamed to isObjectLiteral ? And isObject fixed,
at last, to :
jQuery.isObject = function( obj )
{
return Object.prototype.toString.call(obj) === "[object
Object]" ) ;
}
Or I have missed something ?
--DBJ
--
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=.