From bd4a59c5ec665f73826696a3a7ba4e675c1b69eb Mon Sep 17 00:00:00 2001 From: Michael Gao Date: Tue, 19 Sep 2017 09:22:52 -0700 Subject: [PATCH] Remove args in state.ts#resolveLocalList (#331) Though cloud debugger has args in the proto, args is used to identify passing variables to the functions. Locals, on the other hand is the local variables defined within the function. However, stackdriver debugger UI displays them in the same place with the order of passing variables prior to local variables. In our case, debugger's call frame will have the same effects of ordering passing variables prior to local variables. We can sufficiently merge args and locals in one place. That's the reason of removing args in the code. --- src/agent/state.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/agent/state.ts b/src/agent/state.ts index 4223296d..12010d1c 100644 --- a/src/agent/state.ts +++ b/src/agent/state.ts @@ -325,8 +325,7 @@ class StateResolver { // We will use the values aggregated from the ScopeMirror traversal stored // in locals which will include any applicable arguments from the // invocation. - args = []; - locals = this.resolveLocalsList_(frame, args); + locals = this.resolveLocalsList_(frame); if (isEmpty(locals)) { locals = []; } @@ -370,11 +369,7 @@ class StateResolver { * @returns {Array} - returns an array containing data about selected * variables */ - resolveLocalsList_(frame: v8Types.FrameMirror, args: any): - v8Types.ScopeMirror[] { - // TODO: Determine why `args` is never used in this function - args = args; - + resolveLocalsList_(frame: v8Types.FrameMirror): v8Types.ScopeMirror[] { const self = this; const usedNames: {[name: string]: boolean} = {}; const makeMirror = this.ctx_.MakeMirror;