aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-06 10:30:50 +0000
committerGitHub <noreply@github.com>2020-12-06 18:30:50 +0800
commit3c384cf9a8ed4230cf87f14ab017b613b38df628 (patch)
tree7a03a1426fff2237af9a24861e2872df390eebad /test/compress
parent37f4f56752e0672ff8b76b1618266eae628088f7 (diff)
downloadtracifyjs-3c384cf9a8ed4230cf87f14ab017b613b38df628.tar.gz
tracifyjs-3c384cf9a8ed4230cf87f14ab017b613b38df628.zip
fix corner case in `collapse_vars` (#4332)
fixes #4331
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/spread.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/spread.js b/test/compress/spread.js
index 01818dc3..21ccbe6d 100644
--- a/test/compress/spread.js
+++ b/test/compress/spread.js
@@ -399,3 +399,29 @@ issue_4329: {
expect_stdout: "PASS"
node_version: ">=8"
}
+
+issue_4331: {
+ options = {
+ collapse_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = "PASS", b;
+ console,
+ b = a;
+ (function() {
+ a++;
+ })(...a);
+ console.log(b);
+ }
+ expect: {
+ var a = "PASS", b;
+ console;
+ (function() {
+ a++;
+ })(...b = a);
+ console.log(b);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=8"
+}