summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/xdr/stencil-arg.js
blob: 94ec8f3edcca56769d469b0cfebd743886c1144b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const tests = [
  () => evalStencil(1),
  () => evalStencil({}),
  () => evalStencil([]),
  () => evalStencilXDR(1),
  () => evalStencilXDR({}),
  () => evalStencilXDR([]),
  () => instantiateModuleStencil(1),
  () => instantiateModuleStencil({}),
  () => instantiateModuleStencil([]),
  () => instantiateModuleStencilXDR(1),
  () => instantiateModuleStencilXDR({}),
  () => instantiateModuleStencilXDR([]),
];

for (const test of tests) {
  let caught = false;
  try {
    test();
  } catch (e) {
    assertEq(/Stencil( XDR)? object expected/.test(e.message), true);
    caught = true;
  }
  assertEq(caught, true);
}