MCPcopy Create free account
hub / github.com/Snapchat/Valdi / fromRuntime

Method fromRuntime

valdi/vscode_debugger/src/adapter/stackTrace.ts:23–41  ·  view source on GitHub ↗
(thread: Thread, stack: Cdp.Runtime.StackTrace)

Source from the content-addressed store, hash-verified

21 private _lastFrameThread?: Thread;
22
23 public static fromRuntime(thread: Thread, stack: Cdp.Runtime.StackTrace): StackTrace {
24 const result = new StackTrace(thread);
25 const callFrames = stack.callFrames;
26
27 // Remove any frames on top that are within a log point.
28 while (callFrames.length && LogPointCompiler.isLogPointUrl(callFrames[0].url)) {
29 callFrames.splice(0, 1);
30 }
31
32 for (const callFrame of stack.callFrames)
33 result._frames.push(StackFrame.fromRuntime(thread, callFrame));
34 if (stack.parentId) {
35 result._asyncStackTraceId = stack.parentId;
36 console.assert(!stack.parent);
37 } else {
38 result._appendStackTrace(thread, stack.parent);
39 }
40 return result;
41 }
42
43 public static fromDebugger(
44 thread: Thread,

Callers 3

_onConsoleMessageMethod · 0.45
_formatExceptionMethod · 0.45
_appendStackTraceMethod · 0.45

Calls 4

_appendStackTraceMethod · 0.95
isLogPointUrlMethod · 0.80
assertMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected