mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-27 19:13:55 +08:00
fix($cacheFactory): return undefined when removing non-existent entry
Instead of throwning an exception, remove should return undefined when cache entry to be removed doesn't exist. Closes #1497
This commit is contained in:
@@ -89,6 +89,11 @@ describe('$cacheFactory', function() {
|
||||
}));
|
||||
|
||||
|
||||
it('should return undefined when entry does not exist', inject(function($cacheFactory) {
|
||||
expect(cache.remove('non-existent')).toBeUndefined();
|
||||
}));
|
||||
|
||||
|
||||
it('should stringify keys', inject(function($cacheFactory) {
|
||||
cache.put('123', 'foo');
|
||||
cache.put(123, 'bar');
|
||||
|
||||
Reference in New Issue
Block a user