* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 425 | * @param {Function} fn |
| 426 | */ |
| 427 | function createPositionalPseudo( fn ) { |
| 428 | return markFunction(function( argument ) { |
| 429 | argument = +argument; |
| 430 | return markFunction(function( seed, matches ) { |
| 431 | var j, |
| 432 | matchIndexes = fn( [], seed.length, argument ), |
| 433 | i = matchIndexes.length; |
| 434 | |
| 435 | // Match elements found at the specified indexes |
| 436 | while ( i-- ) { |
| 437 | if ( seed[ (j = matchIndexes[i]) ] ) { |
| 438 | seed[j] = !(matches[j] = seed[j]); |
| 439 | } |
| 440 | } |
| 441 | }); |
| 442 | }); |
| 443 | } |
| 444 | |
| 445 | /** |
| 446 | * Checks a node for validity as a Sizzle context |
no test coverage detected