MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / createRawStackTrace

Function createRawStackTrace

src/devtools/DevtoolsUtils.ts:265–292  ·  view source on GitHub ↗
(
  rawStackTrace: StackTraceLike,
)

Source from the content-addressed store, hash-verified

263 * targets that have no DevTools universe, such as extension service workers.
264 */
265export function createRawStackTrace(
266 rawStackTrace: StackTraceLike,
267): FormattableStackTrace {
268 const toFrames = (
269 callFrames: StackTraceLike['callFrames'],
270 ): FormattableFrame[] =>
271 callFrames.map(frame => ({
272 url: frame.url,
273 name: frame.functionName || undefined,
274 line: frame.lineNumber,
275 column: frame.columnNumber,
276 }));
277 const asyncFragments = [];
278 for (
279 let asyncStack = rawStackTrace.parent;
280 asyncStack;
281 asyncStack = asyncStack.parent
282 ) {
283 asyncFragments.push({
284 description: asyncStack.description ?? '',
285 frames: toFrames(asyncStack.callFrames),
286 });
287 }
288 return {
289 syncFragment: {frames: toFrames(rawStackTrace.callFrames)},
290 asyncFragments,
291 };
292}
293
294/**
295 * Maximum number of `cause` links resolved for one error. A page can create a

Callers 1

#fromDetailsMethod · 0.85

Calls 1

toFramesFunction · 0.85

Tested by

no test coverage detected