fix corner case in hoist_vars (#4840)

fixes #4839
This commit is contained in:
Alex Lam S.L
2021-04-03 03:07:18 +01:00
committed by GitHub
parent 10fbf8e295
commit 0df028187d
2 changed files with 29 additions and 2 deletions

View File

@@ -6937,7 +6937,9 @@ merge(Compressor.prototype, {
&& vars.has(sym.name)) {
var def = vars.get(sym.name);
if (def.value) break;
def.value = expr.right.clone();
var value = expr.right;
if (value instanceof AST_Sequence) value = value.clone();
def.value = value;
remove(defs, def);
defs.push(def);
body.shift();