aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index cf4e45a5..86e8d632 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -6435,3 +6435,36 @@ call_assign_order: {
}
expect_stdout: "PASS PASS"
}
+
+issue_3573: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ var c = 0;
+ (function(b) {
+ while (--b) {
+ b = NaN;
+ switch (0 / this < 0) {
+ case c++, false:
+ case c++, NaN:
+ }
+ }
+ })(3);
+ console.log(c);
+ }
+ expect: {
+ var c = 0;
+ (function(b) {
+ while (--b) {
+ b = NaN;
+ switch (0 / this < 0) {
+ case c++, false:
+ case c++, NaN:
+ }
+ }
+ })(3);
+ console.log(c);
+ }
+ expect_stdout: "1"
+}