summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/set-has-string-gczeal.js
blob: 9ef81634d6fe4cd9a0708dc82cb5b3f81b0dbad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Ensure string hashing works correctly under gczeal=compact.

gczeal(14)

function test() {
  var set = new Set();
  var c = 0;
  var N = 1000;
  for (var i = 0; i < N; ++i) {
    var k = String.fromCodePoint(i);
    set.add(k);
    if (set.has(k)) c++;
  }
  assertEq(c, N);
}

test();