diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-11 20:24:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 03:24:44 +0800 |
commit | bd2f53bc8b505ff5bba4e899ea4886d856128b39 (patch) | |
tree | 6a2af7b8dfdff15b9ba99ddeb50850ae51b3b5ee /test/compress/evaluate.js | |
parent | e8a7956b6f0a71bed038a2b8936eb30d91e94d73 (diff) | |
download | tracifyjs-bd2f53bc8b505ff5bba4e899ea4886d856128b39.tar.gz tracifyjs-bd2f53bc8b505ff5bba4e899ea4886d856128b39.zip |
fix corner case in `evaluate` (#3883)
fixes #3882
Diffstat (limited to 'test/compress/evaluate.js')
-rw-r--r-- | test/compress/evaluate.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index a4bee8cc..60f059a8 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -2369,3 +2369,29 @@ issue_3878_2: { } expect_stdout: "NaN" } + +issue_3882: { + options = { + evaluate: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f(a) { + return console.log(a++), a && this; + } + var b = f(); + console.log(b); + } + expect: { + var b = function(a) { + return console.log(a++), a && this; + }(); + console.log(b); + } + expect_stdout: [ + "NaN", + "NaN", + ] +} |