michael@0: // Map.prototype.delete works whether the key is present or not. michael@0: michael@0: var m = new Map; michael@0: var key = {}; michael@0: michael@0: // when the map is new michael@0: assertEq(m.delete(key), false); michael@0: assertEq(m.has(key), false); michael@0: michael@0: // when the key is present michael@0: assertEq(m.set(key, 'x'), undefined); michael@0: assertEq(m.delete(key), true); michael@0: assertEq(m.has(key), false); michael@0: assertEq(m.get(key), undefined); michael@0: michael@0: // when the key has already been deleted michael@0: assertEq(m.delete(key), false); michael@0: assertEq(m.has(key), false);