* Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry
()
| 565 | * deleting the oldest entry |
| 566 | */ |
| 567 | function createCache() { |
| 568 | var keys = []; |
| 569 | |
| 570 | function cache( key, value ) { |
| 571 | |
| 572 | // Use (key + " ") to avoid collision with native prototype properties |
| 573 | // (see https://github.com/jquery/sizzle/issues/157) |
| 574 | if ( keys.push( key + " " ) > jQuery.expr.cacheLength ) { |
| 575 | |
| 576 | // Only keep the most recent entries |
| 577 | delete cache[ keys.shift() ]; |
| 578 | } |
| 579 | return ( cache[ key + " " ] = value ); |
| 580 | } |
| 581 | return cache; |
| 582 | } |
| 583 | |
| 584 | /** |
| 585 | * Checks a node for validity as a jQuery selector context |
no outgoing calls
no test coverage detected