diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-11-07 20:38:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 20:38:03 +0800 |
commit | 87e67ec29958a4167d5c202ae3a0fe4be1e10faf (patch) | |
tree | e0980c2c8fb6ab78abb2856ca10766bc0460d1d3 /test/compress/collapse_vars.js | |
parent | 61a0dad9fe9a39245ff89a6c01bac8f1788f3293 (diff) | |
download | tracifyjs-87e67ec29958a4167d5c202ae3a0fe4be1e10faf.tar.gz tracifyjs-87e67ec29958a4167d5c202ae3a0fe4be1e10faf.zip |
fix corner case in `collapse_vars` (#3574)
fixes #3573
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 33 |
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" +} |