From dee8e45ef35b4e97693a03c8199e7556823cf5c3 Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 11 Nov 2009 13:42:50 -0500 Subject: [PATCH] Removed the use of this.length++ as it makes it hard to use the init method directly. Fixes #4955. --- src/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.js b/src/core.js index addff6b..793f122 100644 --- a/src/core.js +++ b/src/core.js @@ -56,7 +56,7 @@ jQuery.fn = jQuery.prototype = { // Handle $(DOMElement) if ( selector.nodeType ) { this.context = this[0] = selector; - this.length++; + this.length = 1; return this; } @@ -96,7 +96,7 @@ jQuery.fn = jQuery.prototype = { } // Otherwise, we inject the element directly into the jQuery object - this.length++; + this.length = 1; this[0] = elem; } -- 1.7.10.4