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

add TDZ taint to references #17

Open michaelficarra opened 9 years ago

michaelficarra commented 9 years ago

It'd be nice if a reference to a block-scope variable let you know if that reference is in the temporal dead zone or not.

ikarienator commented 9 years ago

@michaelficarra define temporal dead zone.

michaelficarra commented 9 years ago

A reference to a block-scoped variable that would be evaluated before its declaration is in the temporal dead zone.

bakkot commented 8 years ago

This is not a static property, so I don't think it's suitable for static analysis:

let f = () => x;
f(); // TDZ violation
let x;
f(); // not a TDZ violation
michaelficarra commented 8 years ago

Well the static property is "definitely", "possibly", or "definitely not". It relies on control flow analysis, which is some effort on its own.