summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/function-references/disabled.js
blob: 70a66a937d0d356dd30fbaa8165105a02c13708d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// |jit-test| skip-if: wasmFunctionReferencesEnabled()

const { CompileError, validate } = WebAssembly;

const UNRECOGNIZED_OPCODE_OR_BAD_TYPE = /unrecognized opcode|bad type|\(ref T\) types not enabled/;

let simpleTests = [
    `(module (func (param (ref 0)) (unreachable)))`,
];

// Test that use of function-references fails when function-references is disabled.

for (let src of simpleTests) {
    let bin = wasmTextToBinary(src);
    assertEq(validate(bin), false);
    wasmCompilationShouldFail(bin, UNRECOGNIZED_OPCODE_OR_BAD_TYPE);
}