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

Lexical declarations should be visible within the entire switch #34

Closed bakkot closed 7 years ago

bakkot commented 7 years ago

E.g. probe1() and probe2() should both evaluate to inside, but the scope analyzer will report that probe2 evaluates to outside.

let x = 'outside';
var probe1, probe2;

switch (null) {
  case null:
    let x = 'inside';
    probe1 = function() { return x; };
  case null:
    probe2 = function() { return x; };
}