(key, value)
| 332 | var keys = []; |
| 333 | |
| 334 | function cache(key, value) { |
| 335 | // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) |
| 336 | // 为了避免缓存太多,导致内存使用过大,所以这里可以设置cache长度。默认是 |
| 337 | // cacheLength: 50, |
| 338 | if (keys.push(key += " ") > Expr.cacheLength) { |
| 339 | // Only keep the most recent entries |
| 340 | // 超过缓存,那就把缓存的第一个删掉 |
| 341 | delete cache[keys.shift()]; |
| 342 | } |
| 343 | return (cache[key] = value); |
| 344 | } |
| 345 | return cache; |
| 346 | } |
| 347 |
nothing calls this directly
no outgoing calls
no test coverage detected