aboutsummaryrefslogtreecommitdiff
path: root/test/compress/properties.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-07-27 19:34:44 +0800
committerGitHub <noreply@github.com>2018-07-27 19:34:44 +0800
commitd47547dc71a7e0ba717348995a02a0703ef8f149 (patch)
treec42b2541093e2fab59a060c02f654cd8ac298593 /test/compress/properties.js
parent304db15a20551fad9b4ee1a55c1777ea7844416a (diff)
downloadtracifyjs-d47547dc71a7e0ba717348995a02a0703ef8f149.tar.gz
tracifyjs-d47547dc71a7e0ba717348995a02a0703ef8f149.zip
fix corner case in `join_vars` (#3224)
Diffstat (limited to 'test/compress/properties.js')
-rw-r--r--test/compress/properties.js30
1 files changed, 30 insertions, 0 deletions
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"
+}