Skip to content
Permalink
Browse files

jquery core: closes #5186. getElementsByTagName optimization was brea…

…king the selector attribute.
  • Loading branch information
flesler committed Sep 9, 2009
1 parent 9de120e commit bf230ffb6a1e0aae4dd0d4dae67ed2cafa19ecbb
Showing with 2 additions and 2 deletions.
  1. +2 −2 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;
}

0 comments on commit bf230ff

Please sign in to comment.
You can’t perform that action at this time.