From dfb86ccdd1dfe6f07953afc8c308b00c9c6856b1 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 1 Jan 2021 23:53:15 +0000 Subject: fix corner case in `conditionals` (#4492) --- test/compress/spread.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/compress') 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, -- cgit v1.2.3