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

Commit

Permalink
Remove args in state.ts#resolveLocalList (#331)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gaofanmichael committed Sep 19, 2017
1 parent 9ecff8b commit bd4a59c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/agent/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
}
Expand Down Expand Up @@ -370,11 +369,7 @@ class StateResolver {
* @returns {Array<Object>} - 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;
Expand Down

0 comments on commit bd4a59c

Please sign in to comment.