MCPcopy Create free account
hub / github.com/nodejs/node / assertInstantiateError

Function assertInstantiateError

deps/v8/test/mjsunit/wasm/errors.js:22–29  ·  view source on GitHub ↗
(error, bytes, imports = {}, msg)

Source from the content-addressed store, hash-verified

20}
21
22function assertInstantiateError(error, bytes, imports = {}, msg) {
23 assertThrows(
24 () => new WebAssembly.Instance(new WebAssembly.Module(bytes), imports),
25 error, 'WebAssembly.Instance(): ' + msg);
26 assertThrowsAsync(
27 WebAssembly.instantiate(bytes, imports), error,
28 'WebAssembly.instantiate(): ' + msg);
29}
30
31// default imports to {} so we get LinkError by default, thus allowing us to
32// distinguish the TypeError we want to catch

Callers 2

assertTypeErrorFunction · 0.70
assertLinkErrorFunction · 0.70

Calls 3

assertThrowsFunction · 0.50
assertThrowsAsyncFunction · 0.50
instantiateMethod · 0.45

Tested by

no test coverage detected