* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 999 | * @param {Function} fn |
| 1000 | */ |
| 1001 | function createPositionalPseudo( fn ) { |
| 1002 | return markFunction(function( argument ) { |
| 1003 | argument = +argument; |
| 1004 | return markFunction(function( seed, matches ) { |
| 1005 | var j, |
| 1006 | matchIndexes = fn( [], seed.length, argument ), |
| 1007 | i = matchIndexes.length; |
| 1008 | |
| 1009 | // Match elements found at the specified indexes |
| 1010 | while ( i-- ) { |
| 1011 | if ( seed[ (j = matchIndexes[i]) ] ) { |
| 1012 | seed[j] = !(matches[j] = seed[j]); |
| 1013 | } |
| 1014 | } |
| 1015 | }); |
| 1016 | }); |
| 1017 | } |
| 1018 | |
| 1019 | /** |
| 1020 | * Checks a node for validity as a Sizzle context |
no test coverage detected