summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/gc/regress-1739330.js
blob: 99e519d2d90c06549c38482ac1782781171cc90c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// |jit-test| skip-if: !wasmGcEnabled()

try {
  gczeal(4);
  function a(b) {
    binary = wasmTextToBinary(b)
    c = new WebAssembly.Module(binary)
    return new WebAssembly.Instance(c)
  }
  d = [];
  let { newStruct } = a(`
    (type $e (struct))
      (func (export "newStruct")
        (result eqref)
        struct.new $e
      )
  `).exports
  d.push(newStruct());
  gczeal(14, 7);
  throw d;
} catch (d) {
  assertEq(d instanceof Array, true);
}