Skip to content

Commit

Permalink
jquery core: closes #5186. getElementsByTagName optimization was brea…
Browse files Browse the repository at this point in the history
…king the selector attribute.
  • Loading branch information
flesler committed Sep 9, 2009
1 parent 9de120e commit bf230ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.js
Expand Up @@ -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, $(...))
Expand All @@ -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;
}
Expand Down

0 comments on commit bf230ff

Please sign in to comment.