aboutsummaryrefslogtreecommitdiff
path: root/test/compress/spreads.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/spreads.js')
-rw-r--r--test/compress/spreads.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/test/compress/spreads.js b/test/compress/spreads.js
index 7c98fdcd..7eac2482 100644
--- a/test/compress/spreads.js
+++ b/test/compress/spreads.js
@@ -846,3 +846,75 @@ issue_4556: {
expect_stdout: "undefined"
node_version: ">=6"
}
+
+issue_4560_1: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = 0;
+ (function(...{
+ [a++]: {},
+ }) {})(2);
+ console.log(a);
+ }
+ expect: {
+ var a = 0;
+ (function(...{
+ [a++]: {},
+ }) {})(2);
+ console.log(a);
+ }
+ expect_stdout: "1"
+ node_version: ">=6"
+}
+
+issue_4560_2: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = 0;
+ (function(...{
+ [a++]: {},
+ }) {})(2);
+ console.log(a);
+ }
+ expect: {
+ var a = 0;
+ (function(...{
+ [a++]: {},
+ }) {})(2);
+ console.log(a);
+ }
+ expect_stdout: "1"
+ node_version: ">=6"
+}
+
+issue_4560_3: {
+ options = {
+ collapse_vars: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = 0, b;
+ [ ...{
+ [a++]: b,
+ } ] = [ "PASS" ];
+ console.log(b);
+ }
+ expect: {
+ var a = 0, b;
+ [ ...{
+ [a++]: b,
+ } ] = [ "PASS" ];
+ console.log(b);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}