fix corner case in arguments (#4609)

fixes #4608
This commit is contained in:
Alex Lam S.L
2021-02-02 15:07:31 +00:00
committed by GitHub
parent 7110c6923b
commit 3c556b8689
3 changed files with 51 additions and 10 deletions

View File

@@ -3703,14 +3703,6 @@ merge(Compressor.prototype, {
var lazy_op = makePredicate("&& ||");
function is_lhs(node, parent) {
if (parent instanceof AST_Assign) return parent.left === node && node;
if (parent instanceof AST_DefaultValue) return parent.name === node && node;
if (parent instanceof AST_Destructured) return node;
if (parent instanceof AST_DestructuredKeyVal) return node;
if (parent instanceof AST_Unary) return unary_side_effects[parent.operator] && parent.expression;
}
(function(def) {
function to_node(value, orig) {
if (value instanceof AST_Node) return value.clone(true);