Commit 4ea4fad0 authored by John Resig's avatar John Resig

Optimize jQuery() for the case $("TAG").

parent 1e750a00
...@@ -109,6 +109,10 @@ jQuery.fn = jQuery.prototype = { ...@@ -109,6 +109,10 @@ jQuery.fn = jQuery.prototype = {
return this; return this;
} }
// HANDLE: $("TAG")
} else if ( !context && /^\w+$/.test( selector ) ) {
selector = document.getElementsByTagName( selector );
// HANDLE: $(expr, $(...)) // HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) { } else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector ); return (context || rootjQuery).find( selector );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment