MCPcopy
hub / github.com/apache/caldera / createPositionalPseudo

Function createPositionalPseudo

static/jquery/jquery.js:1025–1041  ·  view source on GitHub ↗

* Returns a function to use in pseudos for positionals * @param {Function} fn

( fn )

Source from the content-addressed store, hash-verified

1023 * @param {Function} fn
1024 */
1025function createPositionalPseudo( fn ) {
1026 return markFunction(function( argument ) {
1027 argument = +argument;
1028 return markFunction(function( seed, matches ) {
1029 var j,
1030 matchIndexes = fn( [], seed.length, argument ),
1031 i = matchIndexes.length;
1032
1033 // Match elements found at the specified indexes
1034 while ( i-- ) {
1035 if ( seed[ (j = matchIndexes[i]) ] ) {
1036 seed[j] = !(matches[j] = seed[j]);
1037 }
1038 }
1039 });
1040 });
1041}
1042
1043/**
1044 * Checks a node for validity as a Sizzle context

Callers 1

jquery.jsFile · 0.85

Calls 1

markFunctionFunction · 0.85

Tested by

no test coverage detected