X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=c095f741a8886eeee1b4bf1a755ed3045a980e8e;hb=69212c501f8875b4650847053cc41eaa470e5848;hp=924bf965e3b4e71e433b0d83a753273eefe7c5cd;hpb=5e50079b1472d9fef27fdc3f59c0f2e494556dd9;p=jquery.git diff --git a/src/core.js b/src/core.js index 924bf96..c095f74 100644 --- a/src/core.js +++ b/src/core.js @@ -266,7 +266,7 @@ jQuery.fn = jQuery.prototype = { return jQuery.find( selector, elem ); }); - return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + return this.pushStack( /[^+>] [^+>]/.test( selector ) ? jQuery.unique( elems ) : elems ); }, @@ -441,7 +441,7 @@ jQuery.fn = jQuery.prototype = { }, eq: function( i ) { - return this.slice( i, i + 1 ); + return this.slice( i, +i + 1 ); }, slice: function() { @@ -613,9 +613,10 @@ jQuery.extend({ }, // See test/unit/core.js for details concerning this function. + // Since 1.3 DOM methods and function like alert + // aren't supported. They return false on IE (#2968). isFunction: function( fn ) { - return !!fn && typeof fn != "string" && !fn.nodeName && - fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + return fn instanceof Function; }, // check if an element is in a (or is an) XML document @@ -1221,7 +1222,7 @@ var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], + version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], safari: /webkit/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), @@ -1309,7 +1310,7 @@ jQuery.each({ remove: function( selector ) { if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) { // Prevent memory leaks - jQuery( "*", this ).add(this).each(function(){ + jQuery( "*", this ).add([this]).each(function(){ jQuery.event.remove(this); jQuery.removeData(this); });