( rawStackTrace: StackTraceLike, )
| 263 | * targets that have no DevTools universe, such as extension service workers. |
| 264 | */ |
| 265 | export 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 |
no test coverage detected