aboutsummaryrefslogtreecommitdiff
path: root/test/compress/evaluate.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-11 20:24:44 +0100
committerGitHub <noreply@github.com>2020-05-12 03:24:44 +0800
commitbd2f53bc8b505ff5bba4e899ea4886d856128b39 (patch)
tree6a2af7b8dfdff15b9ba99ddeb50850ae51b3b5ee /test/compress/evaluate.js
parente8a7956b6f0a71bed038a2b8936eb30d91e94d73 (diff)
downloadtracifyjs-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.js26
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",
+ ]
+}