MCPcopy Index your code
hub / github.com/nodejs/node / testErrorPosition

Function testErrorPosition

deps/v8/test/mjsunit/wasm/streaming-error-position.js:11–20  ·  view source on GitHub ↗
(bytes, pos, message)

Source from the content-addressed store, hash-verified

9d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
10
11function testErrorPosition(bytes, pos, message) {
12 const buffer = bytes.trunc_buffer();
13 // First check the non-streaming decoder as a reference.
14 const regexp = new RegExp(message + '.*@\\+' + pos);
15 assertThrows(
16 () => new WebAssembly.Module(buffer), WebAssembly.CompileError, regexp);
17 // Next test the actual streaming decoder.
18 assertThrowsAsync(
19 WebAssembly.compile(buffer), WebAssembly.CompileError, regexp);
20}
21
22(function testInvalidMagic() {
23 let bytes = new Binary;

Callers 1

Calls 4

assertThrowsFunction · 0.50
assertThrowsAsyncFunction · 0.50
trunc_bufferMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected