fix corner case in inline (#3822)

fixes #3821
This commit is contained in:
Alex Lam S.L
2020-04-26 20:31:19 +01:00
committed by GitHub
parent 36dcfa3e82
commit a4a8ccea8c
2 changed files with 52 additions and 2 deletions

View File

@@ -6130,8 +6130,12 @@ merge(Compressor.prototype, {
return;
}
if (node instanceof AST_Scope) return abort = true;
var def;
if (node instanceof AST_SymbolRef && fn.variables.get(node.name) === (def = node.definition())) {
if (node instanceof AST_SymbolRef) {
var def = node.definition();
if (fn.variables.get(node.name) !== def) {
in_order = null;
return;
}
if (def.init instanceof AST_Defun) return abort = true;
if (is_lhs(node, this.parent())) return abort = true;
var index = resolve_index(def);