aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2008-12-20 22:45:11 +0000
committerJohn Resig <jeresig@gmail.com>2008-12-20 22:45:11 +0000
commit6048e40a4514445e17e9db255b949cb5e7a556c0 (patch)
treefc88178a7adc771d0956f6ac275219801df00253 /src
parent6f2f1830a4cbf8c9a6a74e80e920915f87673119 (diff)
downloadjquery-6048e40a4514445e17e9db255b949cb5e7a556c0.tar.gz
jquery-6048e40a4514445e17e9db255b949cb5e7a556c0.zip
Syncing Sizzle codebase.
Diffstat (limited to 'src')
-rw-r--r--src/selector.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/selector.js b/src/selector.js
index c89b92eea..a74974042 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -12,7 +12,7 @@ var done = 0;
if ( document.addEventListener && !document.querySelectorAll ) {
cache = {};
- function invalidate(){ cache = {}; }
+ var invalidate = function(){ cache = {}; };
document.addEventListener("DOMAttrModified", invalidate, false);
document.addEventListener("DOMNodeInserted", invalidate, false);
document.addEventListener("DOMNodeRemoved", invalidate, false);
@@ -59,24 +59,24 @@ var Sizzle = function(selector, context, results, seed) {
selector = selector.replace( Expr.match.POS, "" );
}
- checkSet = Sizzle.filter( later, Sizzle( selector, context, results ) );
+ set = Sizzle.filter( later, Sizzle( selector, context ) );
} else {
- checkSet = Expr.relative[ parts[0] ] ?
+ set = Expr.relative[ parts[0] ] ?
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
- set = [];
+ var tmpSet = [];
selector = parts.shift();
if ( Expr.relative[ selector ] )
selector += parts.shift();
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- Sizzle( selector, checkSet[i], set );
+ for ( var i = 0, l = set.length; i < l; i++ ) {
+ Sizzle( selector, set[i], tmpSet );
}
- checkSet = set;
+ set = tmpSet;
}
}
} else {
@@ -104,10 +104,10 @@ var Sizzle = function(selector, context, results, seed) {
Expr.relative[ cur ]( checkSet, pop );
}
+ }
- if ( !checkSet ) {
- checkSet = set;
- }
+ if ( !checkSet ) {
+ checkSet = set;
}
if ( !checkSet ) {