X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=944e8a9bf7ec8c06089ea4cb8a3f7175fc022cf3;hb=f298cce100c6fe23840ac95e66aaea9cb2bfb447;hp=0c0d5a2e1d291c1e451abcc3352e76bfdf0c514e;hpb=d40083c866738727aa7ffd7f13d2955bc9575d5e;p=jquery.git diff --git a/src/core.js b/src/core.js index 0c0d5a2..944e8a9 100644 --- a/src/core.js +++ b/src/core.js @@ -164,7 +164,7 @@ jQuery.fn = jQuery.prototype = { return this.length; }, - toArray: function(){ + toArray: function() { return slice.call( this, 0 ); }, @@ -258,7 +258,7 @@ jQuery.fn = jQuery.prototype = { }, map: function( callback ) { - return this.pushStack( jQuery.map(this, function(elem, i){ + return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, @@ -379,7 +379,10 @@ jQuery.extend({ }, bindReady: function() { - if ( readyBound ) { return; } + if ( readyBound ) { + return; + } + readyBound = true; // Catch cases where $(document).ready() is called after the @@ -411,7 +414,7 @@ jQuery.extend({ try { toplevel = window.frameElement == null; - } catch(e){} + } catch(e) {} if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); @@ -433,7 +436,8 @@ jQuery.extend({ isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. - if ( !obj || toString.call(obj) !== "[object Object]" || !("constructor" in obj) ) { + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { return false; } @@ -613,7 +617,7 @@ jQuery.extend({ // Use of jQuery.browser is frowned upon. // More details: http://docs.jquery.com/Utilities/jQuery.browser browser: { - version: (/.*?(?:firefox|safari|opera|msie)[\/ ]([\d.]+)/.exec(userAgent) || [0,'0'])[1], + version: (/.*?(?:firefox|safari|opera|msie)[\/ ]([\d.]+)/.exec(userAgent) || [0,"0"])[1], safari: /safari/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),