(Runtime: Client['Runtime'], frame: any, parsedScripts: any[])
| 56 | } |
| 57 | |
| 58 | async function collectScopes(Runtime: Client['Runtime'], frame: any, parsedScripts: any[]) { |
| 59 | const scopes: any[] = []; |
| 60 | for (const s of frame.scopeChain || []) { |
| 61 | const type = s.type; |
| 62 | if (!s.object || !s.object.objectId) continue; |
| 63 | const variables = await getProps(Runtime, s.object.objectId, type === 'global' ? 5 : 20); |
| 64 | scopes.push({ type, variables, truncated: type === 'global' }); |
| 65 | } |
| 66 | let thisSummary: any = null; |
| 67 | if (frame.this) { |
| 68 | const t = frame.this; |
| 69 | thisSummary = { type: t.type, description: t.description, className: t.className }; |
| 70 | if (t.objectId) thisSummary.preview = await getProps(Runtime, t.objectId, 8); |
| 71 | } |
| 72 | return { |
| 73 | frame: { |
| 74 | functionName: frame.functionName || null, |
| 75 | url: frameUrl(frame, parsedScripts), |
| 76 | line: frame.location.lineNumber + 1, |
| 77 | column: (frame.location.columnNumber ?? 0) + 1 |
| 78 | }, |
| 79 | this: thisSummary, |
| 80 | scopes |
| 81 | }; |
| 82 | } |
| 83 | |
| 84 | test('advanced: scopes, this, arguments, and call stack across steps', { timeout: 30000 }, async () => { |
| 85 | const { proc, port } = await startDebuggedProcess(scriptPath); |
no test coverage detected