fix cascade on multi-branch evaluations (#2067)

Partially reverts #2059 as this has better coverage and performance.

fixes #2062
This commit is contained in:
Alex Lam S.L
2017-06-07 19:52:01 +08:00
committed by GitHub
parent f2af093402
commit 9db0695b10
2 changed files with 24 additions and 4 deletions

View File

@@ -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"
}