shapesecurity / shift-scope-js

scope analyser for the Shift AST
http://shift-ast.org/scope.html
Apache License 2.0
11 stars 6 forks source link

Feature request: mark variables as closed over #56

Open bakkot opened 6 years ago

bakkot commented 6 years ago

It's possible to derive this from the scope tree, but slightly annoying. And it's useful for certain types of transformations: for example, assuming no dynamic scope,

x && x.a();
x && x.b();

can be transformed into

x && (x.a(), x.b());

if x is known to be local and x is known not to be closed over.