* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 296 | * @param {Function} fn |
| 297 | */ |
| 298 | function createPositionalPseudo( fn ) { |
| 299 | return markFunction( function( argument ) { |
| 300 | argument = +argument; |
| 301 | return markFunction( function( seed, matches ) { |
| 302 | var j, |
| 303 | matchIndexes = fn( [], seed.length, argument ), |
| 304 | i = matchIndexes.length; |
| 305 | |
| 306 | // Match elements found at the specified indexes |
| 307 | while ( i-- ) { |
| 308 | if ( seed[ ( j = matchIndexes[ i ] ) ] ) { |
| 309 | seed[ j ] = !( matches[ j ] = seed[ j ] ); |
| 310 | } |
| 311 | } |
| 312 | } ); |
| 313 | } ); |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * Sets document-related variables once based on the current document |
no test coverage detected