aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorSebi Burkhard <sebi.burkhard@gmail.com>2012-12-19 00:20:56 +0700
committerDave Methvin <dave.methvin@gmail.com>2012-12-23 15:09:10 -0500
commitd8298046311e66a47424ec3f3cbe77e97bee3958 (patch)
treedebd8136f2cec958dc174f46685db969852fee73 /src/core.js
parent4de4be42f6327c4f3d833191caf6ee9caa89c852 (diff)
downloadjquery-d8298046311e66a47424ec3f3cbe77e97bee3958.tar.gz
jquery-d8298046311e66a47424ec3f3cbe77e97bee3958.zip
Fix #13076. Speed up $() with strings, part of gh-1089.
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js
index 844eb1593..5927d1936 100644
--- a/src/core.js
+++ b/src/core.js
@@ -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;