* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 970 | * @param {Function} fn |
| 971 | */ |
| 972 | function createPositionalPseudo( fn ) { |
| 973 | return markFunction(function( argument ) { |
| 974 | argument = +argument; |
| 975 | return markFunction(function( seed, matches ) { |
| 976 | var j, |
| 977 | matchIndexes = fn( [], seed.length, argument ), |
| 978 | i = matchIndexes.length; |
| 979 | |
| 980 | // Match elements found at the specified indexes |
| 981 | while ( i-- ) { |
| 982 | if ( seed[ (j = matchIndexes[i]) ] ) { |
| 983 | seed[j] = !(matches[j] = seed[j]); |
| 984 | } |
| 985 | } |
| 986 | }); |
| 987 | }); |
| 988 | } |
| 989 | |
| 990 | /** |
| 991 | * Checks a node for validity as a Sizzle context |
no test coverage detected