( selector, match /* Internal Use Only */ )
| 1245 | } |
| 1246 | |
| 1247 | function 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 |
no test coverage detected