diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-06-07 19:52:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-07 19:52:01 +0800 |
commit | 9db0695b10799349c005fc14ab1268c2478c25fd (patch) | |
tree | b55efd0fb46d3bb2d94ca924a14cd8943bf4ff4a /test/compress | |
parent | f2af0934021a83b781f207432d10380cc4c5f396 (diff) | |
download | tracifyjs-9db0695b10799349c005fc14ab1268c2478c25fd.tar.gz tracifyjs-9db0695b10799349c005fc14ab1268c2478c25fd.zip |
fix `cascade` on multi-branch evaluations (#2067)
Partially reverts #2059 as this has better coverage and performance.
fixes #2062
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/sequences.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/compress/sequences.js b/test/compress/sequences.js index 10492565..f41b603f 100644 --- a/test/compress/sequences.js +++ b/test/compress/sequences.js @@ -710,3 +710,23 @@ issue_27: { })(jQuery); } } + +issue_2062: { + options = { + booleans: true, + cascade: true, + conditionals: true, + side_effects: true, + } + input: { + var a = 1; + if ([ a || a++ + a--, a++ + a--, a && a.var ]); + console.log(a); + } + expect: { + var a = 1; + a || (a++, a--), a++, --a && a.var; + console.log(a); + } + expect_stdout: "1" +} |