* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 1409 | * @param {Function} fn |
| 1410 | */ |
| 1411 | function createPositionalPseudo( fn ) { |
| 1412 | return markFunction(function( argument ) { |
| 1413 | argument = +argument; |
| 1414 | return markFunction(function( seed, matches ) { |
| 1415 | var j, |
| 1416 | matchIndexes = fn( [], seed.length, argument ), |
| 1417 | i = matchIndexes.length; |
| 1418 | |
| 1419 | // Match elements found at the specified indexes |
| 1420 | while ( i-- ) { |
| 1421 | if ( seed[ (j = matchIndexes[i]) ] ) { |
| 1422 | seed[j] = !(matches[j] = seed[j]); |
| 1423 | } |
| 1424 | } |
| 1425 | }); |
| 1426 | }); |
| 1427 | } |
| 1428 | |
| 1429 | /** |
| 1430 | * Detect xml |
no test coverage detected