Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error on object properties #51

Open
lcwj3 opened this issue Nov 19, 2020 · 0 comments
Open

Parsing error on object properties #51

lcwj3 opened this issue Nov 19, 2020 · 0 comments

Comments

@lcwj3
Copy link

lcwj3 commented Nov 19, 2020

Hi, I am trying to use this tool to generate call graphs for node.js packages, however, I find a parsing logic error from your tool. Here is my example:

define(function (require, exports) {  
  var test = {  
      keys: ()=>(console.log(a))
  }
  var x = {
    keys: () => (console.log(b))
  }
  test.keys();
  x.keys();
  var c = 9;
  Object.keys(c);
});

When parsing this js file, it seems the dftc algorithm didn't handle cases like property name for different objects. In this case, when function visit1 in dftc.js finds calls for keys of test, it firstly find the expression of func, then prop of 'keys', while here is only use the 'keys' to match call expressions, and finally, the call graph contains calls that from line 8,9,11 to both test.keys and x.keys, 6 calls in total.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant