fix corner case in side_effects (#5479)

fixes #5478
This commit is contained in:
Alex Lam S.L
2022-05-30 17:27:40 +01:00
committed by GitHub
parent 8bc03dc6c4
commit 3c9e1693d5
2 changed files with 37 additions and 0 deletions

View File

@@ -8345,6 +8345,9 @@ Compressor.prototype.compress = function(node) {
var dropped = value.drop_side_effect_free(compressor);
if (dropped !== value) {
changed = true;
if (dropped && async && !is_primitive(compressor, dropped)) {
dropped = dropped.negate(compressor);
}
node.value = dropped;
}
}