1 | Index: src/selector/selector.js |
---|
2 | =================================================================== |
---|
3 | --- src/selector/selector.js (revision 1016) |
---|
4 | +++ src/selector/selector.js (working copy) |
---|
5 | @@ -297,6 +297,10 @@ |
---|
6 | }, |
---|
7 | |
---|
8 | filter: function(t,r,not) { |
---|
9 | + // Support for array selectors |
---|
10 | + if ( typeof t == 'object' ) |
---|
11 | + t = t.join(','); |
---|
12 | + |
---|
13 | // Look for common filter expressions |
---|
14 | while ( t && /^[a-z[({<*:.#]/i.test(t) ) { |
---|
15 | |
---|
16 | @@ -312,13 +316,13 @@ |
---|
17 | var m = re.exec( t ); |
---|
18 | |
---|
19 | if ( m ) { |
---|
20 | + // Remove what we just matched |
---|
21 | + t = t.substring( m[0].length ); |
---|
22 | + |
---|
23 | // Re-organize the first match |
---|
24 | if ( jQuery.expr[ m[1] ]._resort ) |
---|
25 | m = jQuery.expr[ m[1] ]._resort( m ); |
---|
26 | |
---|
27 | - // Remove what we just matched |
---|
28 | - t = t.replace( re, "" ); |
---|
29 | - |
---|
30 | break; |
---|
31 | } |
---|
32 | } |
---|
33 | Index: src/selector/selectorTest.js |
---|
34 | =================================================================== |
---|
35 | --- src/selector/selectorTest.js (revision 1016) |
---|
36 | +++ src/selector/selectorTest.js (working copy) |
---|
37 | @@ -41,6 +41,12 @@ |
---|
38 | t( "Comma Support", "a.blog,div", ["mark","simon","main","foo"] ); |
---|
39 | }); |
---|
40 | |
---|
41 | +test("expressions - array", function() { |
---|
42 | + expect(1); |
---|
43 | + t( "Array Support", ["a.blog", "div"], ["mark","simon","main","foo"] ); |
---|
44 | +}); |
---|
45 | + |
---|
46 | + |
---|
47 | test("expressions - child and adjacent", function() { |
---|
48 | expect(14); |
---|
49 | t( "Child", "p > a", ["simon1","google","groups","mark","yahoo","simon"] ); |
---|