Fix #13076. Speed up $() with strings, part of gh-1089.

This commit is contained in:
Sebi Burkhard 2012-12-19 00:20:56 +07:00 committed by Dave Methvin
parent 4de4be42f6
commit d829804631
2 changed files with 3 additions and 3 deletions

View File

@ -156,4 +156,4 @@ Matthias Jäggli <matthias.jaeggli@gmail.com>
Yiming He <yiminghe@gmail.com>
Devin Cooper <cooper.semantics@gmail.com>
Bennett Sorbo <bsorbo@gmail.com>
Sebastian Burkhard <sebi.burkhard@gmail.com>

View File

@ -96,8 +96,8 @@ jQuery.fn = jQuery.prototype = {
return this;
}
// HANDLE: $(DOMElement)
if ( selector.nodeType ) {
// HANDLE: $(DOMElement); check first that selector is not a primitive
if ( typeof selector === "object" && selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;