summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/stencil-compile-invalid-argument.js
blob: 26ed7b9eb4a0fb03067044044e11297960691c2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Passing non-object to `options` argument of stencil testing functions should
// throw.

load(libdir + "asserts.js");

const stencil = compileToStencil("");
const xdr = compileToStencilXDR("");

for (const arg of [0, 1.1, "foo", true, false, null, Symbol.iterator]) {
  assertThrowsInstanceOf(() => compileToStencil("", arg), Error);
  assertThrowsInstanceOf(() => evalStencil(stencil, arg), Error);
  assertThrowsInstanceOf(() => compileToStencilXDR("", arg), Error);
  assertThrowsInstanceOf(() => evalStencilXDR(xdr, arg), Error);
}