* Returns a function to use in pseudos for positionals * @param {Function} fn
( fn )
| 1075 | * @param {Function} fn |
| 1076 | */ |
| 1077 | function createPositionalPseudo( fn ) { |
| 1078 | return markFunction( function( argument ) { |
| 1079 | argument = +argument; |
| 1080 | return markFunction( function( seed, matches ) { |
| 1081 | var j, |
| 1082 | matchIndexes = fn( [], seed.length, argument ), |
| 1083 | i = matchIndexes.length; |
| 1084 | |
| 1085 | // Match elements found at the specified indexes |
| 1086 | while ( i-- ) { |
| 1087 | if ( seed[ ( j = matchIndexes[ i ] ) ] ) { |
| 1088 | seed[ j ] = !( matches[ j ] = seed[ j ] ); |
| 1089 | } |
| 1090 | } |
| 1091 | } ); |
| 1092 | } ); |
| 1093 | } |
| 1094 | |
| 1095 | /** |
| 1096 | * Checks a node for validity as a jQuery selector context |
no test coverage detected