fix corner case in reduce_vars (#4569)

fixes #4568
This commit is contained in:
Alex Lam S.L
2021-01-18 22:34:48 +00:00
committed by GitHub
parent e23a10f7f9
commit b57bae4b9e
3 changed files with 49 additions and 1 deletions

View File

@@ -9733,7 +9733,7 @@ merge(Compressor.prototype, {
single_use = false;
}
if (single_use) fixed.parent_scope = self.scope;
} else if (!fixed || !fixed.is_constant_expression()) {
} else if (!fixed || !fixed.is_constant_expression() || fixed.drop_side_effect_free(compressor)) {
single_use = false;
}
}