* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 1379 | * @param {Function} fn |
| 1380 | */ |
| 1381 | function createPositionalPseudo( fn ) { |
| 1382 | return markFunction( function( argument ) { |
| 1383 | argument = +argument; |
| 1384 | return markFunction( function( seed, matches ) { |
| 1385 | var j, |
| 1386 | matchIndexes = fn( [], seed.length, argument ), |
| 1387 | i = matchIndexes.length; |
| 1388 | |
| 1389 | // Match elements found at the specified indexes |
| 1390 | while ( i-- ) { |
| 1391 | if ( seed[ ( j = matchIndexes[ i ] ) ] ) { |
| 1392 | seed[ j ] = !( matches[ j ] = seed[ j ] ); |
| 1393 | } |
| 1394 | } |
| 1395 | } ); |
| 1396 | } ); |
| 1397 | } |
| 1398 | |
| 1399 | /** |
| 1400 | * Sets document-related variables once based on the current document |
no test coverage detected