compute uses_arguments correctly in figure_out_scope() (#2099)

fixes #2097
This commit is contained in:
Alex Lam S.L
2017-06-15 03:28:26 +08:00
committed by GitHub
parent 0a1e523cd5
commit 3f961bbba0
2 changed files with 31 additions and 3 deletions

View File

@@ -336,3 +336,32 @@ issue_2084: {
}
expect_stdout: "0"
}
issue_2097: {
options = {
negate_iife: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f() {
try {
throw 0;
} catch (e) {
console.log(arguments[0]);
}
}
f(1);
}
expect: {
!function() {
try {
throw 0;
} catch (e) {
console.log(arguments[0]);
}
}(1);
}
expect_stdout: "1"
}