fix corner case in collapse_vars (#5169)

fixes #5168
This commit is contained in:
Alex Lam S.L
2021-11-13 14:18:18 +00:00
committed by GitHub
parent eaa84d32df
commit e9932e1314
2 changed files with 30 additions and 2 deletions

View File

@@ -1501,7 +1501,7 @@ merge(Compressor.prototype, {
AST_SymbolRef.DEFMETHOD("is_immutable", function() {
var def = this.redef || this.definition();
return def.orig.length == 1 && def.orig[0] instanceof AST_SymbolLambda;
return (this.in_arg || def.orig.length == 1) && def.orig[0] instanceof AST_SymbolLambda;
});
AST_Node.DEFMETHOD("convert_symbol", noop);
@@ -3369,10 +3369,10 @@ merge(Compressor.prototype, {
}
}
statements.length = n;
CHANGED = n != len;
if (has_quit) has_quit.forEach(function(stat) {
extract_declarations_from_unreachable_code(compressor, stat, statements);
});
CHANGED = statements.length != len;
}
function sequencesize(statements, compressor) {