MCPcopy Index your code
hub / github.com/jquery/jquery / compile

Function compile

dist-module/jquery.module.js:2325–2355  ·  view source on GitHub ↗
( selector, match /* Internal Use Only */ )

Source from the content-addressed store, hash-verified

2323}
2324
2325function compile( selector, match /* Internal Use Only */ ) {
2326 var i,
2327 setMatchers = [],
2328 elementMatchers = [],
2329 cached = compilerCache[ selector + " " ];
2330
2331 if ( !cached ) {
2332
2333 // Generate a function of recursive functions that can be used to check each element
2334 if ( !match ) {
2335 match = tokenize( selector );
2336 }
2337 i = match.length;
2338 while ( i-- ) {
2339 cached = matcherFromTokens( match[ i ] );
2340 if ( cached[ jQuery.expando ] ) {
2341 setMatchers.push( cached );
2342 } else {
2343 elementMatchers.push( cached );
2344 }
2345 }
2346
2347 // Cache the compiled function
2348 cached = compilerCache( selector,
2349 matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2350
2351 // Save selector and tokenization
2352 cached.selector = selector;
2353 }
2354 return cached;
2355}
2356
2357/**
2358 * A low-level selection function that works with jQuery's compiled

Callers 2

jQueryFactoryFunction · 0.70
selectFunction · 0.70

Calls 3

tokenizeFunction · 0.70
matcherFromTokensFunction · 0.70
matcherFromGroupMatchersFunction · 0.70

Tested by

no test coverage detected