diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-10-20 03:53:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-20 03:53:20 +0800 |
commit | ca6dce43feb9d92cb5004c6ee4d5b2e0b4336d93 (patch) | |
tree | 993c51498c77a037410589184a907e765f72282f /test/compress/collapse_vars.js | |
parent | 543dd7d3d750e83b00e50bbf74fa786a7c1d243e (diff) | |
download | tracifyjs-ca6dce43feb9d92cb5004c6ee4d5b2e0b4336d93.tar.gz tracifyjs-ca6dce43feb9d92cb5004c6ee4d5b2e0b4336d93.zip |
fix corner case in `collapse_vars` (#3501)
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 2381333a..951d72d6 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -6237,3 +6237,24 @@ issue_3439_2: { } expect_stdout: "number" } + +cond_sequence_return: { + options = { + collapse_vars: true, + } + input: { + console.log(function(n) { + var c = 0; + for (var k in [0, 1]) + if (c++, k == n) return c; + }(1)); + } + expect: { + console.log(function(n) { + var c = 0; + for (var k in [0, 1]) + if (c++, k == n) return c; + }(1)); + } + expect_stdout: "2" +} |