aboutsummaryrefslogtreecommitdiff
path: root/test/compress/destructured.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/destructured.js')
-rw-r--r--test/compress/destructured.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 1555e3e3..6feb5bd6 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -1403,3 +1403,40 @@ issue_4284_3: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4286_1: {
+ options = {
+ collapse_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = "PASS", b;
+ (0 && a)[{ a } = b = a];
+ console.log(b);
+ }
+ expect: {
+ var a = "PASS", b;
+ (0 && a)[{ a } = b = a];
+ console.log(b);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}
+
+issue_4286_2: {
+ options = {
+ collapse_vars: true,
+ toplevel: true,
+ }
+ input: {
+ a = [ "PASS" ];
+ var b, { a } = b = a;
+ console.log(b[0]);
+ }
+ expect: {
+ var b, { a } = b = a = [ "PASS" ];
+ console.log(b[0]);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}