summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-clear-3.js
blob: 902a4cf292e3d7ddbe43849116f62889a65b68bd (plain)
1
2
3
4
5
6
7
8
9
10
// Clearing a Map with a nontrivial number of elements works.

var m = new Map();
for (var i = 0; i < 100; i++)
    m.set(i, i);
assertEq(m.size, i);
m.clear();
assertEq(m.size, 0);
m.set("a", 1);
assertEq(m.get("a"), 1);