suppress unused on block variables (#1969)

fixes #1968
This commit is contained in:
Alex Lam S.L
2017-05-19 00:28:19 +08:00
committed by GitHub
parent aaba482e48
commit 3db2001633
2 changed files with 32 additions and 6 deletions

View File

@@ -1253,3 +1253,30 @@ reassign_const: {
}
expect_stdout: true
}
issue_1968: {
options = {
unused: true,
}
input: {
function f(c) {
var a;
if (c) {
let b;
return (a = 2) + (b = 3);
}
}
console.log(f(1));
}
expect: {
function f(c) {
if (c) {
let b;
return 2 + (b = 3);
}
}
console.log(f(1));
}
expect_stdout: "5"
node_version: ">=6"
}