MCPcopy Create free account
hub / github.com/components/jquery / compile

Function compile

jquery.js:2339–2369  ·  view source on GitHub ↗
( selector, match /* Internal Use Only */ )

Source from the content-addressed store, hash-verified

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

Callers 2

jquery.jsFile · 0.70
selectFunction · 0.70

Calls 3

tokenizeFunction · 0.70
matcherFromTokensFunction · 0.70
matcherFromGroupMatchersFunction · 0.70

Tested by

no test coverage detected