git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e750a0
)
Optimize jQuery() for the case $("TAG").
author
John Resig
<jeresig@gmail.com>
Tue, 8 Sep 2009 04:26:47 +0000
(
04:26
+0000)
committer
John Resig
<jeresig@gmail.com>
Tue, 8 Sep 2009 04:26:47 +0000
(
04:26
+0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
a7cbdc9
..
5fa944b
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-109,6
+109,10
@@
jQuery.fn = jQuery.prototype = {
return this;
}
+ // HANDLE: $("TAG")
+ } else if ( !context && /^\w+$/.test( selector ) ) {
+ selector = document.getElementsByTagName( selector );
+
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );