summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Map-Set-moving-gc.js
blob: e603756dc32d1a4524a2bdb651fbf50838cf301f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var m = new Map;
var s = new Set;

var A = [];
for (var i = 0; i < 1024; ++i) {
    var key = {i:i};
    m.set(key, i);
    s.add(key);
    A.push(key);
}
gc();
for (var i in A) {
    var key = A[i];
    assertEq(m.has(key), true);
    assertEq(s.has(key), true);
}