fix corner case in hoist_vars (#4894)

fixes #4893
This commit is contained in:
Alex Lam S.L
2021-05-02 00:28:31 +01:00
committed by GitHub
parent 6ab26eef6c
commit fb03561799
4 changed files with 87 additions and 8 deletions

View File

@@ -1793,7 +1793,7 @@ merge(Compressor.prototype, {
return make_node(AST_Assign, candidate, {
operator: "=",
left: make_node(AST_SymbolRef, candidate.name, candidate.name),
right: candidate.value
right: candidate.value,
});
}
var assign = candidate;
@@ -8433,6 +8433,7 @@ merge(Compressor.prototype, {
if (value) {
if (value instanceof AST_Sequence) value = value.clone();
var name = make_node(AST_SymbolRef, defn.name, defn.name);
name.fixed = value;
a.push(make_node(AST_Assign, defn, {
operator: "=",
left: name,