Add MapCache tests.

This commit is contained in:
John-David Dalton
2014-11-28 15:31:44 -08:00
parent 3f9a878b03
commit fa3b384c6f
2 changed files with 24 additions and 9 deletions

View File

@@ -1455,7 +1455,7 @@
* @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
*/
function mapDelete(key) {
return delete this.__data__[key];
return this.has(key) && delete this.__data__[key];
}
/**
@@ -1468,7 +1468,7 @@
* @returns {*} Returns the cached value.
*/
function mapGet(key) {
return this.__data__[key];
return key == '__proto__' ? undefined : this.__data__[key];
}
/**