fix corner case in conditionals (#4948)

fixes #4947
This commit is contained in:
Alex Lam S.L
2021-05-20 11:08:22 +01:00
committed by GitHub
parent e0695ef549
commit 4a19575e74
2 changed files with 31 additions and 0 deletions

View File

@@ -11412,6 +11412,7 @@ merge(Compressor.prototype, {
function is_tail_equivalent(consequent, alternative) {
if (consequent.TYPE != alternative.TYPE) return;
if (consequent.optional != alternative.optional) return;
if (consequent instanceof AST_Call) {
if (arg_diff(consequent, alternative) != -1) return;
return consequent.TYPE != "Call"