aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-12-04 20:24:55 +0800
committerGitHub <noreply@github.com>2019-12-04 20:24:55 +0800
commitd68ddc31f94074e09c661cb79ea43cef9adb44e6 (patch)
tree5b46e937fe694f31e7c8acc5e5d395eb230544d9 /test/compress
parent500e31e03b69d3c6fa219a74f9131c2abc9c9730 (diff)
downloadtracifyjs-d68ddc31f94074e09c661cb79ea43cef9adb44e6.tar.gz
tracifyjs-d68ddc31f94074e09c661cb79ea43cef9adb44e6.zip
fix corner case in `reduce_vars` (#3623)
fixes #3622
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/reduce_vars.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index a3421c00..443c347d 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -6774,3 +6774,30 @@ issue_3509: {
}
expect_stdout: "PASS"
}
+
+issue_3622: {
+ options = {
+ evaluate: true,
+ inline: true,
+ keep_fargs: "strict",
+ reduce_vars: true,
+ sequences: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var c = "FAIL";
+ !function(b, a) {
+ a && (c = "PASS");
+ }(42, this);
+ console.log(c);
+ }
+ expect: {
+ var c = "FAIL";
+ var a;
+ a = this,
+ !void (a && (c = "PASS")),
+ console.log(c);
+ }
+ expect_stdout: "PASS"
+}