MCPcopy
hub / github.com/jquery-backstretch/jquery-backstretch / createCache

Function createCache

libs/jquery/jquery.js:3713–3726  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3711 },
3712
3713 createCache = function() {
3714 var cache = {},
3715 keys = [];
3716
3717 return markFunction(function( key, value ) {
3718 // Only keep the most recent entries
3719 if ( keys.push( key ) > Expr.cacheLength ) {
3720 delete cache[ keys.shift() ];
3721 }
3722
3723 // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157)
3724 return (cache[ key + " " ] = value);
3725 }, cache );
3726 },
3727
3728 classCache = createCache(),
3729 tokenCache = createCache(),

Callers 1

jquery.jsFile · 0.85

Calls 1

markFunctionFunction · 0.85

Tested by

no test coverage detected