fix corner case collapse_vars (#5569)

fixes #5568
This commit is contained in:
Alex Lam S.L
2022-07-18 02:04:51 +01:00
committed by GitHub
parent ec4558be29
commit f0120e90b6
4 changed files with 36 additions and 1 deletions

View File

@@ -2080,7 +2080,7 @@ Compressor.prototype.compress = function(node) {
return node;
}
// Skip transient nodes caused by single-use variable replacement
if (node.single_use && parent instanceof AST_VarDef && parent.value === node) return node;
if (node.single_use) return node;
// Replace variable with assignment when found
var hit_rhs;
if (!(node instanceof AST_SymbolDeclaration)