]> source.dussan.org Git - jquery.git/commitdiff
Removed the use of this.length++ as it makes it hard to use the init method directly...
authorJohn Resig <jeresig@gmail.com>
Wed, 11 Nov 2009 18:42:50 +0000 (13:42 -0500)
committerJohn Resig <jeresig@gmail.com>
Wed, 11 Nov 2009 18:42:50 +0000 (13:42 -0500)
src/core.js

index addff6bde760d48b93867cd265474229b22b54d6..793f122ac691ab7f0b250da08204b3705e381096 100644 (file)
@@ -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;
                                        }