Skip to content

Commit 042e529

Browse files
authored
Default args and locals params in debugger snapshot hooks (#4609)
Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
1 parent 17793d2 commit 042e529

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • packages/debugger/src/domain

packages/debugger/src/domain/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function resetDebuggerTransport(): void {
4444
* @param self - The 'this' context
4545
* @param args - Function arguments
4646
*/
47-
export function onEntry(probes: InitializedProbe[], self: any, args: Record<string, any>): void {
47+
export function onEntry(probes: InitializedProbe[], self: any, args: Record<string, any> = {}): void {
4848
const start = performance.now()
4949
const captureCtx: CaptureContext = { deadline: start + SNAPSHOT_TIMEOUT_MS, timedOut: false }
5050

@@ -125,8 +125,8 @@ export function onReturn(
125125
probes: InitializedProbe[],
126126
value: any,
127127
self: any,
128-
args: Record<string, any>,
129-
locals: Record<string, any>
128+
args: Record<string, any> = {},
129+
locals: Record<string, any> = {}
130130
): any {
131131
const end = performance.now()
132132
const captureCtx: CaptureContext = { deadline: performance.now() + SNAPSHOT_TIMEOUT_MS, timedOut: false }
@@ -195,7 +195,7 @@ export function onReturn(
195195
* @param self - The 'this' context
196196
* @param args - Function arguments
197197
*/
198-
export function onThrow(probes: InitializedProbe[], error: Error, self: any, args: Record<string, any>): void {
198+
export function onThrow(probes: InitializedProbe[], error: Error, self: any, args: Record<string, any> = {}): void {
199199
const end = performance.now()
200200
const captureCtx: CaptureContext = { deadline: performance.now() + SNAPSHOT_TIMEOUT_MS, timedOut: false }
201201

0 commit comments

Comments
 (0)