MCPcopy
hub / github.com/microsoft/vscode-js-debug / _appendStackTrace

Method _appendStackTrace

src/adapter/stackTrace.ts:192–214  ·  view source on GitHub ↗
(thread: Thread, stackTrace: Cdp.Runtime.StackTrace | undefined)

Source from the content-addressed store, hash-verified

190 }
191
192 private _appendStackTrace(thread: Thread, stackTrace: Cdp.Runtime.StackTrace | undefined) {
193 console.assert(!stackTrace || !this._asyncStackTraceId);
194
195 while (stackTrace) {
196 if (stackTrace.description === 'async function' && stackTrace.callFrames.length) {
197 stackTrace.callFrames.shift();
198 }
199
200 if (stackTrace.callFrames.length) {
201 this._appendFrame(new AsyncSeparator(stackTrace.description || 'async'));
202 for (const callFrame of stackTrace.callFrames) {
203 this._appendFrame(StackFrame.fromRuntime(thread, callFrame, true));
204 }
205 }
206
207 if (stackTrace.parentId) {
208 this._asyncStackTraceId = stackTrace.parentId;
209 console.assert(!stackTrace.parent);
210 }
211
212 stackTrace = stackTrace.parent;
213 }
214 }
215
216 private _spliceFrames(index: number, deleteCount: number, ...frames: FrameElement[]) {
217 this.frames.splice(index, deleteCount, ...frames);

Callers 3

fromRuntimeMethod · 0.95
fromDebuggerMethod · 0.95
expandAsyncStackMethod · 0.95

Calls 4

_appendFrameMethod · 0.95
shiftMethod · 0.80
assertMethod · 0.65
fromRuntimeMethod · 0.45

Tested by

no test coverage detected