Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit bd4a59c

Browse files
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.
1 parent 9ecff8b commit bd4a59c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/agent/state.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ class StateResolver {
325325
// We will use the values aggregated from the ScopeMirror traversal stored
326326
// in locals which will include any applicable arguments from the
327327
// invocation.
328-
args = [];
329-
locals = this.resolveLocalsList_(frame, args);
328+
locals = this.resolveLocalsList_(frame);
330329
if (isEmpty(locals)) {
331330
locals = [];
332331
}
@@ -370,11 +369,7 @@ class StateResolver {
370369
* @returns {Array<Object>} - returns an array containing data about selected
371370
* variables
372371
*/
373-
resolveLocalsList_(frame: v8Types.FrameMirror, args: any):
374-
v8Types.ScopeMirror[] {
375-
// TODO: Determine why `args` is never used in this function
376-
args = args;
377-
372+
resolveLocalsList_(frame: v8Types.FrameMirror): v8Types.ScopeMirror[] {
378373
const self = this;
379374
const usedNames: {[name: string]: boolean} = {};
380375
const makeMirror = this.ctx_.MakeMirror;

0 commit comments

Comments
 (0)