retrofit AST_BlockStatement as block-scoped (#4177)

This commit is contained in:
Alex Lam S.L
2020-10-04 18:58:50 +01:00
committed by GitHub
parent 58ac5b9bd5
commit f9946767c9
6 changed files with 104 additions and 59 deletions

View File

@@ -2993,6 +2993,38 @@ issue_4146: {
expect_stdout: "function"
}
var_catch_redefined: {
options = {
toplevel: true,
unused: true,
}
input: {
var a = "FAIL";
try {
throw "PASS";
} catch (a) {
function f() {
return a;
}
console.log(a);
}
f();
}
expect: {
var a = "FAIL";
try {
throw "PASS";
} catch (a) {
function f() {
return a;
}
console.log(a);
}
f();
}
expect_stdout: "PASS"
}
single_use_catch_redefined: {
options = {
reduce_vars: true,