diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-05-21 12:55:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 12:55:34 +0800 |
commit | b9053c7a25ff1ad86345e0196437671609756afa (patch) | |
tree | c47811ee41e1654ce5648e5e370863e9e5dd735d /test | |
parent | d357a7aabc7512e53ff135c917b05997e5158a2d (diff) | |
download | tracifyjs-b9053c7a25ff1ad86345e0196437671609756afa.tar.gz tracifyjs-b9053c7a25ff1ad86345e0196437671609756afa.zip |
fix corner case in `keep_fargs` (#3424)
fixes #3423
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/keep_fargs.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/compress/keep_fargs.js b/test/compress/keep_fargs.js index 558b10bb..74b801d3 100644 --- a/test/compress/keep_fargs.js +++ b/test/compress/keep_fargs.js @@ -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" +} |