From d8298046311e66a47424ec3f3cbe77e97bee3958 Mon Sep 17 00:00:00 2001 From: Sebi Burkhard Date: Wed, 19 Dec 2012 00:20:56 +0700 Subject: [PATCH] Fix #13076. Speed up $() with strings, part of gh-1089. --- AUTHORS.txt | 2 +- src/core.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 639ed4b64..62df6f5a5 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -156,4 +156,4 @@ Matthias Jäggli Yiming He Devin Cooper Bennett Sorbo - \ No newline at end of file +Sebastian Burkhard 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; -- 2.39.5