Skip to content

Commit

Permalink
Removed the use of this.length++ as it makes it hard to use the init …
Browse files Browse the repository at this point in the history
…method directly. Fixes jquery#4955.
  • Loading branch information
jeresig committed Nov 11, 2009
1 parent ca8a9e8 commit dee8e45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit dee8e45

Please sign in to comment.