Fixed bug #180 as suggested, changing xxx.constructor == Function to typeof xxx = "function"
This commit is contained in:
parent
b240975a91
commit
3b4eeab044
8
src/jquery/jquery.js
vendored
8
src/jquery/jquery.js
vendored
|
@ -31,7 +31,7 @@ window.undefined = window.undefined;
|
||||||
jQuery = function(a,c) {
|
jQuery = function(a,c) {
|
||||||
|
|
||||||
// Shortcut for document ready (because $(document).each() is silly)
|
// Shortcut for document ready (because $(document).each() is silly)
|
||||||
if ( a && a.constructor == Function && jQuery.fn.ready )
|
if ( a && typeof a == "function" && jQuery.fn.ready )
|
||||||
return jQuery(document).ready(a);
|
return jQuery(document).ready(a);
|
||||||
|
|
||||||
// Make sure that a selection was provided
|
// Make sure that a selection was provided
|
||||||
|
@ -65,7 +65,7 @@ jQuery = function(a,c) {
|
||||||
var fn = arguments[ arguments.length - 1 ];
|
var fn = arguments[ arguments.length - 1 ];
|
||||||
|
|
||||||
// If so, execute it in context
|
// If so, execute it in context
|
||||||
if ( fn && fn.constructor == Function )
|
if ( fn && typeof fn == "function" )
|
||||||
this.each(fn);
|
this.each(fn);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1019,7 +1019,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
t.constructor == Boolean &&
|
t.constructor == Boolean &&
|
||||||
( t ? this.get() : [] ) ||
|
( t ? this.get() : [] ) ||
|
||||||
|
|
||||||
t.constructor == Function &&
|
typeof t == "function" &&
|
||||||
jQuery.grep( this, t ) ||
|
jQuery.grep( this, t ) ||
|
||||||
|
|
||||||
jQuery.filter(t,this).r, arguments );
|
jQuery.filter(t,this).r, arguments );
|
||||||
|
@ -1214,7 +1214,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
} else {
|
} else {
|
||||||
var old = this.get();
|
var old = this.get();
|
||||||
this.get( a );
|
this.get( a );
|
||||||
if ( fn.constructor == Function )
|
if ( typeof fn == "function" )
|
||||||
this.each( fn );
|
this.each( fn );
|
||||||
this.get( old );
|
this.get( old );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue