jquery core: closes #1480, isFunction is even tougher.

This commit is contained in:
Ariel Flesler 2008-05-14 20:10:39 +00:00
parent d524c7eecc
commit b13a961ff5

View file

@ -615,7 +615,7 @@ jQuery.extend({
// See test/unit/core.js for details concerning this function. // See test/unit/core.js for details concerning this function.
isFunction: function( fn ) { isFunction: function( fn ) {
return !!fn && typeof fn != "string" && !fn.nodeName && return !!fn && typeof fn != "string" && !fn.nodeName &&
fn.constructor != Array && /function/i.test( fn + "" ); fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
}, },
// check if an element is in a (or is an) XML document // check if an element is in a (or is an) XML document