fix corner case in reduce_funcs (#3592)

This commit is contained in:
Alex Lam S.L
2019-11-17 11:19:42 +08:00
committed by GitHub
parent 10c1a78772
commit 8504a4ea0e
2 changed files with 120 additions and 32 deletions

View File

@@ -5369,6 +5369,7 @@ merge(Compressor.prototype, {
&& !fn.contains_this()
&& can_inject_symbols()) {
fn._squeezed = true;
if (exp !== fn) fn.parent_scope = exp.scope;
return make_sequence(self, flatten_fn()).optimize(compressor);
}
if (compressor.option("side_effects")
@@ -6382,6 +6383,7 @@ merge(Compressor.prototype, {
} while (scope = scope.parent_scope);
}
}
if (single_use) fixed.parent_scope = self.scope;
}
if (single_use && fixed) {
def.single_use = false;