1 2 3 4 5 6 7 8 9 10 11 12 13 14
// map.delete(k) decrements the map size iff an entry was actually removed. var m = new Map(); m.delete(3); assertEq(m.size, 0); m.set({}, 'ok'); m.set(Math, 'ok'); assertEq(m.size, 2); m.delete({}); assertEq(m.size, 2); m.delete(Math); assertEq(m.size, 1); m.delete(Math); assertEq(m.size, 1);