diff options
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index ed1d8d97..2c7bbdeb 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -4517,3 +4517,32 @@ issue_2891_2: { } expect_stdout: true } + +issue_2908: { + options = { + collapse_vars: true, + } + input: { + var a = 0, b = 0; + function f(c) { + if (1 == c) return; + a++; + if (2 == c) b = a; + } + f(0); + f(2); + console.log(b); + } + expect: { + var a = 0, b = 0; + function f(c) { + if (1 == c) return; + a++; + if (2 == c) b = a; + } + f(0); + f(2); + console.log(b); + } + expect_stdout: "2" +} |