fix corner case in keep_fargs (#3424)

fixes #3423
This commit is contained in:
Alex Lam S.L
2019-05-21 12:55:34 +08:00
committed by GitHub
parent d357a7aabc
commit b9053c7a25
2 changed files with 39 additions and 1 deletions

View File

@@ -1117,3 +1117,41 @@ issue_3420_3: {
}
expect_stdout: "4"
}
issue_3423_1: {
options = {
keep_fargs: "strict",
unused: true,
}
input: {
function f(g) {
console.log(g.length);
}
f(function(a) {});
}
expect: {
function f(g) {
console.log(g.length);
}
f(function(a) {});
}
expect_stdout: "1"
}
issue_3423_2: {
options = {
keep_fargs: "strict",
unused: true,
}
input: {
new function(a) {
console.log(this.constructor.length);
}();
}
expect: {
new function(a) {
console.log(this.constructor.length);
}();
}
expect_stdout: "1"
}