Skip to content

Commit d829804

Browse files
hasclassdmethvin
authored andcommitted
Fix #13076. Speed up $() with strings, part of jquerygh-1089.
1 parent 4de4be4 commit d829804

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ Matthias Jäggli <matthias.jaeggli@gmail.com>
156156
Yiming He <yiminghe@gmail.com>
157157
Devin Cooper <cooper.semantics@gmail.com>
158158
Bennett Sorbo <bsorbo@gmail.com>
159-
159+
Sebastian Burkhard <sebi.burkhard@gmail.com>

src/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ jQuery.fn = jQuery.prototype = {
9696
return this;
9797
}
9898

99-
// HANDLE: $(DOMElement)
100-
if ( selector.nodeType ) {
99+
// HANDLE: $(DOMElement); check first that selector is not a primitive
100+
if ( typeof selector === "object" && selector.nodeType ) {
101101
this.context = this[0] = selector;
102102
this.length = 1;
103103
return this;

0 commit comments

Comments
 (0)