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

Function TestStackTrace

deps/v8/test/mjsunit/wasm/wasm-gc-source-location.js:7–17  ·  view source on GitHub ↗
(testFct, trap, expected)

Source from the content-addressed store, hash-verified

5d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
6
7function TestStackTrace(testFct, trap, expected) {
8 assertTraps(trap, testFct);
9 try {
10 testFct();
11 assertUnreachable();
12 } catch(e) {
13 let regex = /at [^ ]+ \(wasm[^\[]+\[[0-9+]\]:(0x[0-9a-f]+)\)/;
14 let match = e.stack.match(regex);
15 assertEquals(expected, match[1])
16 }
17}
18
19(function CodeLocationRefCast() {
20 print(arguments.callee.name);

Callers 1

Calls 5

testFctFunction · 0.85
assertUnreachableFunction · 0.85
assertTrapsFunction · 0.70
matchMethod · 0.65
assertEqualsFunction · 0.50

Tested by

no test coverage detected