Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /wasm/jsapi/instance/constructor-bad-imports.any.js - WPT Dashboard Interop Dashboard
- /wasm/jsapi/instance/constructor-bad-imports.any.html - WPT Dashboard Interop Dashboard
- /wasm/jsapi/instance/constructor-bad-imports.any.shadowrealm.html - WPT Dashboard Interop Dashboard
- /wasm/jsapi/instance/constructor-bad-imports.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,dedicatedworker,jsshell,shadowrealm
// META: script=/wasm/jsapi/wasm-module-builder.js
// META: script=/wasm/jsapi/bad-imports.js
test_bad_imports((name, error, build, ...arguments) => {
test(() => {
const builder = new WasmModuleBuilder();
build(builder);
const buffer = builder.toBuffer();
const module = new WebAssembly.Module(buffer);
assert_throws_js(error, () => new WebAssembly.Instance(module, ...arguments));
}, `new WebAssembly.Instance(module): ${name}`);
});