fix corner case in unused (#5392)

fixes #5391
This commit is contained in:
Alex Lam S.L
2022-03-27 22:46:43 +01:00
committed by GitHub
parent c624b43739
commit 15a4074d1a
2 changed files with 48 additions and 1 deletions

View File

@@ -6847,7 +6847,14 @@ Compressor.prototype.compress = function(node) {
});
}
}
if (node instanceof AST_Call) calls_to_drop_args.push(node);
if (node instanceof AST_Call) {
calls_to_drop_args.push(node);
node.args = node.args.map(function(arg) {
return arg.transform(tt);
});
node.expression = node.expression.transform(tt);
return node;
}
if (scope !== self) return;
if (drop_funcs && node !== self && node instanceof AST_DefClass) {
var def = node.name.definition();