aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-06-30 17:52:54 +0100
committerGitHub <noreply@github.com>2021-07-01 00:52:54 +0800
commit611abff49f8c5aa158b0bd43c4af3ef79a875905 (patch)
treef2050f0f1661d95c0fe67f06df0543b0cd82030e /test
parent4ba8b66c5aa86e1c2a48be1fc0c4743f9510aabf (diff)
downloadtracifyjs-611abff49f8c5aa158b0bd43c4af3ef79a875905.tar.gz
tracifyjs-611abff49f8c5aa158b0bd43c4af3ef79a875905.zip
fix corner case in `booleans` (#5042)
fixes #5041
Diffstat (limited to 'test')
-rw-r--r--test/compress/booleans.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/booleans.js b/test/compress/booleans.js
index 0926c0e4..280a355d 100644
--- a/test/compress/booleans.js
+++ b/test/compress/booleans.js
@@ -634,3 +634,24 @@ issue_5028_3: {
}
expect_stdout: "-1"
}
+
+issue_5041: {
+ options = {
+ booleans: true,
+ conditionals: true,
+ }
+ input: {
+ var a = 42;
+ if (a)
+ if ([ a = null ])
+ if (a)
+ console.log("FAIL");
+ else
+ console.log("PASS");
+ }
+ expect: {
+ var a = 42;
+ a && [ a = null ] && (a ? console.log("FAIL") : console.log("PASS"));
+ }
+ expect_stdout: "PASS"
+}