From d47547dc71a7e0ba717348995a02a0703ef8f149 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 27 Jul 2018 19:34:44 +0800 Subject: fix corner case in `join_vars` (#3224) --- test/compress/properties.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/compress') diff --git a/test/compress/properties.js b/test/compress/properties.js index d36ae074..3a78d626 100644 --- a/test/compress/properties.js +++ b/test/compress/properties.js @@ -1832,3 +1832,33 @@ issue_3188_3: { } expect_stdout: "PASS" } + +join_expr: { + options = { + evaluate: true, + join_vars: true, + } + input: { + var c = "FAIL"; + (function() { + var a = 0; + switch ((a = {}) && (a.b = 0)) { + case 0: + c = "PASS"; + } + })(); + console.log(c); + } + expect: { + var c = "FAIL"; + (function() { + var a = 0; + switch (a = { b: 0 }, a.b) { + case 0: + c = "PASS"; + } + })(); + console.log(c); + } + expect_stdout: "PASS" +} -- cgit v1.2.3