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

bug with block-scoped declarations in ForStatement/ForInStatement #1

Closed michaelficarra closed 9 years ago

michaelficarra commented 9 years ago
for(let a in b) { a; }
for(let a in b) { let a; a; }
for(let a in b) a;
for(let a;;) { a; }
for(let a;;) { let a; a; }
for(let a;;) a;

Looks like the semantics is that they make their own intermediate scope, so a re-declaration in the block is actually shadowing. See section 13.6.4.8 (Runtime Semantics: ForIn/OfExpressionEvaluation Abstract Operation) step 2. Confirmed with node 0.11.14.

michaelficarra commented 9 years ago

Working on this.