]> source.dussan.org Git - jquery.git/commitdiff
Added fix for broken $("../..",foo).
authorJohn Resig <jeresig@gmail.com>
Thu, 31 Aug 2006 05:16:50 +0000 (05:16 +0000)
committerJohn Resig <jeresig@gmail.com>
Thu, 31 Aug 2006 05:16:50 +0000 (05:16 +0000)
src/jquery/jquery.js

index 28f4825e83c89a4ef6b0b198e2ef7371b07d8fb4..f64835a08a2b8a143b23119131f11206fd7ce911 100644 (file)
@@ -1199,6 +1199,8 @@ jQuery.extend({
                        var foundToken = false;
                        
                        for ( var i = 0; i < jQuery.token.length; i += 2 ) {
+                               if ( foundToken ) continue;
+
                                var re = new RegExp("^(" + jQuery.token[i] + ")");
                                var m = re.exec(t);
                                
@@ -1235,12 +1237,12 @@ jQuery.extend({
                                                        );
                                        }
                                }
-                       }
        
-                       if ( t ) {
-                               var val = jQuery.filter(t,r);
-                               ret = r = val.r;
-                               t = jQuery.trim(val.t);
+                               if ( t ) {
+                                       var val = jQuery.filter(t,r);
+                                       ret = r = val.r;
+                                       t = jQuery.trim(val.t);
+                               }
                        }
                }