fix corner case in inline (#5083)

fixes #5082
This commit is contained in:
Alex Lam S.L
2021-07-16 15:13:33 +01:00
committed by GitHub
parent f18804fa06
commit 902997b73d
2 changed files with 61 additions and 5 deletions

View File

@@ -9522,11 +9522,9 @@ merge(Compressor.prototype, {
refs.forEach(function(ref) {
ref.scope = exp === fn ? fn.parent_scope : exp.scope;
ref.reference();
if (replacing) {
ref.definition().replaced++;
} else {
ref.definition().single_use = false;
}
var def = ref.definition();
if (replacing) def.replaced++;
def.single_use = false;
});
return node;
} else if (!node.has_side_effects(compressor)) {