aboutsummaryrefslogtreecommitdiff
path: root/test/compress/default-values.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/default-values.js')
-rw-r--r--test/compress/default-values.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/compress/default-values.js b/test/compress/default-values.js
index 64dad3cf..8b9b3a95 100644
--- a/test/compress/default-values.js
+++ b/test/compress/default-values.js
@@ -974,3 +974,41 @@ issue_4444: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4446_1: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ a = 42;
+ [ b = 42 ] = [ "PASS" ];
+ c = 42;
+ console.log(b, a);
+ }
+ expect: {
+ [ b = 42 ] = [ "PASS" ];
+ c = a = 42;
+ console.log(b, a);
+ }
+ expect_stdout: "PASS 42"
+ node_version: ">=6"
+}
+
+issue_4446_2: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ a = 42;
+ var [ b = 42 ] = [ "PASS" ];
+ c = 42;
+ console.log(b, a);
+ }
+ expect: {
+ var [ b = 42 ] = [ "PASS" ];
+ c = a = 42;
+ console.log(b, a);
+ }
+ expect_stdout: "PASS 42"
+ node_version: ">=6"
+}