This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
$cacheFactory.remove() does always just size-- but it doesn't have really delete something #12321
Closed
Description
see line:
https://github.com/angular/angular.js/blob/master/src/ng/cacheFactory.js#L227
there size-- is done but just before it we do:
delete data[key];
but there is no test if it is really in the data, so if remove is called with something thats not inside the data nothing is deleted but the size is decreased.
the put function does have a check:
if (!(key in data)) size++;
data[key] = value;
shouldn't remove not have a similar one?