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

Function test

deps/v8/test/mjsunit/es8/async-function-stacktrace.js:7–20  ·  view source on GitHub ↗
(func, funcs)

Source from the content-addressed store, hash-verified

5// Flags: --noasync-stack-traces
6
7async function test(func, funcs) {
8 try {
9 await func();
10 throw new Error("Expected " + func.toString() + " to throw");
11 } catch (e) {
12 var stack = e.stack.split('\n').
13 slice(1).
14 map(line => line.trim()).
15 map(line => line.match(/at (?:(.*) )?.*$/)[1]).
16 filter(x => typeof x === 'string' && x.length);
17
18 assertEquals(funcs, stack, `Unexpected stack trace ${e.stack}`);
19 }
20}
21
22function thrower() { throw new Error("NOPE"); }
23function reject() { return Promise.reject(new Error("NOPE")); }

Callers 1

runTestsFunction · 0.70

Calls 8

filterMethod · 0.65
mapMethod · 0.65
sliceMethod · 0.65
matchMethod · 0.65
funcFunction · 0.50
assertEqualsFunction · 0.50
toStringMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…