aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-13 16:44:54 +0100
committerGitHub <noreply@github.com>2020-05-13 23:44:54 +0800
commitfe2f1965d6efcd1807eea087708ffdb9a5798db0 (patch)
treec81b12f827e8e39e1b4d8bb3024a2fde1752fd41 /test/compress
parent30ed8f558038ea1017ecd8cb4a02851eaed92ac0 (diff)
downloadtracifyjs-fe2f1965d6efcd1807eea087708ffdb9a5798db0.tar.gz
tracifyjs-fe2f1965d6efcd1807eea087708ffdb9a5798db0.zip
fix corner case in `reduce_vars` (#3895)
fixes #3894
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 262a77f2..08accc45 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -7068,3 +7068,30 @@ issue_3880: {
}
expect_stdout: "PASS"
}
+
+issue_3894: {
+ options = {
+ collapse_vars: true,
+ inline: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ function log(msg) {
+ console.log(msg ? "FAIL" : "PASS");
+ }
+ var a;
+ (function(b) {
+ a = 0,
+ log(b);
+ })(-0);
+ }
+ expect: {
+ function log(msg) {
+ console.log(msg ? "FAIL" : "PASS");
+ }
+ var a;
+ void log(-(a = 0));
+ }
+ expect_stdout: "PASS"
+}