I am looking for a tool that displays all usages of global variables (and functions) in a javascript-file.
For example, if I write to following:
function foo() {
for(i = 0; i < 10; i++) {
document.body.innerHTML += "<span>Hello</span>";
}
}
Then, the output should be: i, document - even if "foo" has never been called.
Using this list, most forgotten variable declarations can be found instantly.
I tried using jslint for that (since it displays the global variables), but it is way too strict (even with all "tolerate"-settings active) and does not even parse the whole code before aborting.
Do you know any other tools that can do that?
This is NOT a duplicate of Javascript - dumping all global variables. The accepted answer there is a list of all global variables, after all code has been executed. I am looking for a parser that checks all code before execution.