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

Function compile

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

Source from the content-addressed store, hash-verified

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

Callers 2

jQueryFactoryWrapperFunction · 0.70
selectFunction · 0.70

Calls 3

tokenizeFunction · 0.70
matcherFromTokensFunction · 0.70
matcherFromGroupMatchersFunction · 0.70

Tested by

no test coverage detected