handle var within catch of the same name (#1711)
authorAlex Lam S.L <alexlamsl@gmail.com>
Tue, 28 Mar 2017 08:42:39 +0000 (16:42 +0800)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2017 08:42:39 +0000 (16:42 +0800)
commit65da9acce6bd2548e5ffc7f35527ff62ff3f2fdd
treea236ec345b4d7ea87a9baf112b672a85471fb075
parent67d0237f73c3147855983edde137cd95a2cb1749
handle var within catch of the same name (#1711)

The following code prints `1`:

var a = 1;
!function(){
  a = 4;
  try{
    throw 2;
  } catch (a) {
    var a = 3;
  }
}();
console.log(a);

fixes #1708
lib/scope.js
test/compress/issue-1704.js