]> source.dussan.org Git - jquery.git/commitdiff
Fix #13076. Speed up $() with strings, part of gh-1089.
authorSebi Burkhard <sebi.burkhard@gmail.com>
Tue, 18 Dec 2012 17:20:56 +0000 (00:20 +0700)
committerDave Methvin <dave.methvin@gmail.com>
Sun, 23 Dec 2012 20:09:10 +0000 (15:09 -0500)
AUTHORS.txt
src/core.js

index 639ed4b642b5602a2d0db47deaf80704bffb7e73..62df6f5a5f17ac36bf07cfadbae989fc34061f1b 100644 (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>
\ No newline at end of file
+Sebastian Burkhard <sebi.burkhard@gmail.com>
index 844eb159364f1e51970688884e99274af6f8c430..5927d1936016f0d2815dcf2fa862284dbd597753 100644 (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;