summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-delete-size.js
blob: c2537e0dc1e49ada2679a7e2aeee4ed553a29cc5 (plain)
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);