From bf230ffb6a1e0aae4dd0d4dae67ed2cafa19ecbb Mon Sep 17 00:00:00 2001 From: Ariel Flesler Date: Wed, 9 Sep 2009 16:33:16 +0000 Subject: [PATCH] jquery core: closes #5186. getElementsByTagName optimization was breaking the selector attribute. --- src/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.js b/src/core.js index 5fa944bc..45eaecf6 100644 --- a/src/core.js +++ b/src/core.js @@ -111,6 +111,7 @@ jQuery.fn = jQuery.prototype = { // HANDLE: $("TAG") } else if ( !context && /^\w+$/.test( selector ) ) { + this.selector = selector; selector = document.getElementsByTagName( selector ); // HANDLE: $(expr, $(...)) @@ -129,8 +130,7 @@ jQuery.fn = jQuery.prototype = { return rootjQuery.ready( selector ); } - // Make sure that old selector state is passed along - if ( selector.selector && selector.context ) { + if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context; }