aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-08-06 13:30:28 +0100
committerGitHub <noreply@github.com>2020-08-06 20:30:28 +0800
commita8e286f7e1edcdf9b42b057319963c6ed3c47348 (patch)
tree6630b7d14a8a42a2f5be32f74e1bd59a3b2e7d2f /test/compress/collapse_vars.js
parent9b05494ebcbcc40a6682cf570aa183f045244650 (diff)
downloadtracifyjs-a8e286f7e1edcdf9b42b057319963c6ed3c47348.tar.gz
tracifyjs-a8e286f7e1edcdf9b42b057319963c6ed3c47348.zip
fix corner case in `collapse_vars` (#4041)
fixes #4040
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index d68c10e2..ff6b9a29 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -8375,3 +8375,19 @@ issue_4038: {
}
expect_stdout: "PASS"
}
+
+issue_4040: {
+ options = {
+ collapse_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = console.log("PASS") && a.p;
+ delete NaN;
+ }
+ expect: {
+ var a = console.log("PASS") && a.p;
+ delete NaN;
+ }
+ expect_stdout: "PASS"
+}