mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Removed the use of this.length++ as it makes it hard to use the init method directly. Fixes #4955.
This commit is contained in:
parent
ca8a9e8c30
commit
dee8e45ef3
@ -56,7 +56,7 @@ jQuery.fn = jQuery.prototype = {
|
|||||||
// Handle $(DOMElement)
|
// Handle $(DOMElement)
|
||||||
if ( selector.nodeType ) {
|
if ( selector.nodeType ) {
|
||||||
this.context = this[0] = selector;
|
this.context = this[0] = selector;
|
||||||
this.length++;
|
this.length = 1;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ jQuery.fn = jQuery.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, we inject the element directly into the jQuery object
|
// Otherwise, we inject the element directly into the jQuery object
|
||||||
this.length++;
|
this.length = 1;
|
||||||
this[0] = elem;
|
this[0] = elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user