X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=e48f721a0b956485c36f61e090e19ef7516a3b36;hb=7a724180a726c7b041d87494a4cf8780fc90e216;hp=177d86bf7aae88b98ed7a5b320bf4ec04a936754;hpb=6ac46e6a5a6cac509626267865980f4dfbeebc2d;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 177d86b..e48f721 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -390,7 +390,7 @@ jQuery.fn = jQuery.prototype = { */ attr: function( key, value, type ) { // Check to see if we're setting style values - return key.constructor != String || value != undefined ? + return typeof key != "string" || value != undefined ? this.each(function(){ // See if we're setting a hash of styles if ( value == undefined ) @@ -1029,8 +1029,8 @@ jQuery.fn = jQuery.prototype = { * @cat Core */ pushStack: function(a,args) { - var fn = args && args[args.length-1]; - var fn2 = args && args[args.length-2]; + var fn = args && args.length > 1 && args[args.length-1]; + var fn2 = args && args.length > 2 && args[args.length-2]; if ( fn && fn.constructor != Function ) fn = null; if ( fn2 && fn2.constructor != Function ) fn2 = null; @@ -1456,7 +1456,7 @@ jQuery.extend({ // Set the correct context (if none is provided) context = context || document; - if ( t.constructor != String ) return [t]; + if ( typeof t != "string" ) return [t]; if ( !t.indexOf("//") ) { context = context.documentElement; @@ -1645,7 +1645,7 @@ jQuery.extend({ // Otherwise, find the expression to execute else { var f = jQuery.expr[m[1]]; - if ( f.constructor != String ) + if ( typeof f != "string" ) f = jQuery.expr[m[1]][m[2]]; // Build a custom macro to enclose it