aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-17 17:47:07 +0000
committerGitHub <noreply@github.com>2021-01-18 01:47:07 +0800
commite616916de5d28df06ae33bd4ed3b9431ae47d64b (patch)
tree1d006d6e8ebd0640eb041d4b4c098caaa6a002e3 /test/compress
parent8d2151662355a05f1e2fde864168cfddd8eedcda (diff)
downloadtracifyjs-e616916de5d28df06ae33bd4ed3b9431ae47d64b.tar.gz
tracifyjs-e616916de5d28df06ae33bd4ed3b9431ae47d64b.zip
fix corner case in `reduce_vars` (#4563)
fixes #4562
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/rests.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/compress/rests.js b/test/compress/rests.js
index 6bc5b756..017f871b 100644
--- a/test/compress/rests.js
+++ b/test/compress/rests.js
@@ -646,3 +646,20 @@ issue_4544_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
+
+issue_4562: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ rests: true,
+ unsafe: true,
+ }
+ input: {
+ console.log((([ ...[ a ] ]) => a)("foo"));
+ }
+ expect: {
+ console.log((([ a ]) => a)("foo"));
+ }
+ expect_stdout: "f"
+ node_version: ">=6"
+}