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

Scan functions inside of initializers or function calls #64

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

OndrejSpanel
Copy link

Functions inside of initializers or function calls (and maybe in other positions as well) are currently ignored.

Such functions, passed as callbacks, are common is some JS enviroments.

First commit adds handling for functions defined in variable initializers, like this:

var f = function (s) {
  var something = s.compute()
};

I hope to be able to handle at least following scenario as well:

call(function (s) {
  var something = s.compute()
});

@OndrejSpanel
Copy link
Author

I hope to be able to handle at least following scenario as well:

Should be done:

image

@OndrejSpanel
Copy link
Author

A few more:

  • function used in a return statement:
function (s) {
   return function (www) {
      var localInReturn;
   };
   
})(0);

image

  • function in IIFE:
(function (x) {
   var localInIIFE;
   
})(0);

image

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

Successfully merging this pull request may close these issues.

1 participant