| 27 | * "<scriptId>::<functionName>::<url>::<lineNumber>::<columnNumber>" |
| 28 | */ |
| 29 | export function createStackTrace(callFrameDescriptions: string[]): Protocol.Runtime.StackTrace { |
| 30 | const callFrames: Protocol.Runtime.CallFrame[] = callFrameDescriptions.map(descriptor => { |
| 31 | const fields = descriptor.split('::'); |
| 32 | assert.lengthOf(fields, 5); |
| 33 | return { |
| 34 | scriptId: fields[0] as Protocol.Runtime.ScriptId, |
| 35 | functionName: fields[1], |
| 36 | url: fields[2], |
| 37 | lineNumber: Number.parseInt(fields[3], 10), |
| 38 | columnNumber: Number.parseInt(fields[4], 10), |
| 39 | }; |
| 40 | }); |
| 41 | return {callFrames}; |
| 42 | } |