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

Function compile

src/selector.js:1247–1277  ·  view source on GitHub ↗
( selector, match /* Internal Use Only */ )

Source from the content-addressed store, hash-verified

1245}
1246
1247function compile( selector, match /* Internal Use Only */ ) {
1248 var i,
1249 setMatchers = [],
1250 elementMatchers = [],
1251 cached = compilerCache[ selector + " " ];
1252
1253 if ( !cached ) {
1254
1255 // Generate a function of recursive functions that can be used to check each element
1256 if ( !match ) {
1257 match = tokenize( selector );
1258 }
1259 i = match.length;
1260 while ( i-- ) {
1261 cached = matcherFromTokens( match[ i ] );
1262 if ( cached[ jQuery.expando ] ) {
1263 setMatchers.push( cached );
1264 } else {
1265 elementMatchers.push( cached );
1266 }
1267 }
1268
1269 // Cache the compiled function
1270 cached = compilerCache( selector,
1271 matcherFromGroupMatchers( elementMatchers, setMatchers ) );
1272
1273 // Save selector and tokenization
1274 cached.selector = selector;
1275 }
1276 return cached;
1277}
1278
1279/**
1280 * A low-level selection function that works with jQuery's compiled

Callers 2

selector.jsFile · 0.70
selectFunction · 0.70

Calls 3

tokenizeFunction · 0.90
matcherFromTokensFunction · 0.70
matcherFromGroupMatchersFunction · 0.70

Tested by

no test coverage detected