aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-01 23:53:15 +0000
committerGitHub <noreply@github.com>2021-01-02 07:53:15 +0800
commitdfb86ccdd1dfe6f07953afc8c308b00c9c6856b1 (patch)
treea0679faaa9095183260c7210f902ff694facc522 /test/compress
parent0417a69c3ef4922470b6891ad6039221059f5750 (diff)
downloadtracifyjs-dfb86ccdd1dfe6f07953afc8c308b00c9c6856b1.tar.gz
tracifyjs-dfb86ccdd1dfe6f07953afc8c308b00c9c6856b1.zip
fix corner case in `conditionals` (#4492)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/spread.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/spread.js b/test/compress/spread.js
index 67aa549a..944915fe 100644
--- a/test/compress/spread.js
+++ b/test/compress/spread.js
@@ -85,6 +85,28 @@ collapse_vars_4: {
node_version: ">=6"
}
+conditionals_farg: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ function log(msg) {
+ console.log(msg);
+ }
+ var a = 42, b = [ "PASS" ], c = [ "FAIL" ];
+ a ? log(...b) : log(...c);
+ }
+ expect: {
+ function log(msg) {
+ console.log(msg);
+ }
+ var a = 42, b = [ "PASS" ], c = [ "FAIL" ];
+ log(...a ? b : c);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}
+
dont_inline: {
options = {
inline: true,