aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-24 21:31:12 +0000
committerGitHub <noreply@github.com>2021-02-25 05:31:12 +0800
commit72805ea73a18a93793b0f3f5c64512a057d46e94 (patch)
tree987988c72a99886d5b1c490b6684f146944c7ff1 /test
parenta5e6946f74333fc201e76bcba49d0b160edb4448 (diff)
downloadtracifyjs-72805ea73a18a93793b0f3f5c64512a057d46e94.tar.gz
tracifyjs-72805ea73a18a93793b0f3f5c64512a057d46e94.zip
fix corner case in `collapse_vars` (#4686)
fixes #4685
Diffstat (limited to 'test')
-rw-r--r--test/compress/arrows.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/arrows.js b/test/compress/arrows.js
index 096503d6..a3a46871 100644
--- a/test/compress/arrows.js
+++ b/test/compress/arrows.js
@@ -703,3 +703,24 @@ issue_4666: {
expect_stdout: "true"
node_version: ">=4"
}
+
+issue_4685: {
+ options = {
+ collapse_vars: true,
+ unused: true,
+ }
+ input: {
+ new function(f) {
+ if (f() !== this)
+ console.log("PASS");
+ }(() => this);
+ }
+ expect: {
+ new function(f) {
+ if (f() !== this)
+ console.log("PASS");
+ }(() => this);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=4"
+}