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