aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-20 23:23:06 +0000
committerGitHub <noreply@github.com>2021-01-21 07:23:06 +0800
commitc1e771a89a65751016bbafd56d710accf6d7bf21 (patch)
tree87d21dfd5ab41f0b70e5cf465dd463e26ec39f81 /test/compress
parentbc7a88baea6f81a77f4cde635b9f8c918ddede06 (diff)
downloadtracifyjs-c1e771a89a65751016bbafd56d710accf6d7bf21.tar.gz
tracifyjs-c1e771a89a65751016bbafd56d710accf6d7bf21.zip
fix corner case in `rests` (#4576)
fixes #4575
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/rests.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/rests.js b/test/compress/rests.js
index 017f871b..42e62953 100644
--- a/test/compress/rests.js
+++ b/test/compress/rests.js
@@ -663,3 +663,36 @@ issue_4562: {
expect_stdout: "f"
node_version: ">=6"
}
+
+issue_4575: {
+ options = {
+ collapse_vars: true,
+ ie8: true,
+ reduce_vars: true,
+ rests: true,
+ unused: true,
+ }
+ input: {
+ A = "PASS";
+ (function() {
+ var a = 0, b = a;
+ var c = function a(...b) {
+ A;
+ var d = A;
+ console.log(d, b.length);
+ }();
+ })();
+ }
+ expect: {
+ A = "PASS";
+ (function() {
+ (function(b) {
+ A;
+ var d = A;
+ console.log(d, b.length);
+ })([]);
+ })();
+ }
+ expect_stdout: "PASS 0"
+ node_version: ">=6"
+}