aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-04-24 13:04:31 +0100
committerGitHub <noreply@github.com>2021-04-24 20:04:31 +0800
commitc296a63fb338a6edba6682d821351255e8935fd9 (patch)
tree7204e977014b8a6e240ab495bb43a2727657debb /test/compress/collapse_vars.js
parent10dd9d4eaf3d28479744676e344f0df6b6bd8029 (diff)
downloadtracifyjs-c296a63fb338a6edba6682d821351255e8935fd9.tar.gz
tracifyjs-c296a63fb338a6edba6682d821351255e8935fd9.zip
fix corner case in `collapse_vars` (#4866)
fixes #4865
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 451681b6..4051bb14 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -8993,3 +8993,20 @@ issue_4852: {
}
expect_stdout: "PASS"
}
+
+issue_4865: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ var NaN;
+ var a = NaN = "PASS";
+ console.log(a, NaN);
+ }
+ expect: {
+ var NaN;
+ var a = NaN = "PASS";
+ console.log(a, NaN);
+ }
+ expect_stdout: true
+}