From 8926a2f327f9954e856161169a92a4190f0318e4 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 20 Jul 2021 18:10:58 +0100 Subject: fix corner case in `unused` (#5090) fixes #5089 --- lib/compress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/compress.js') diff --git a/lib/compress.js b/lib/compress.js index c5d75d42..6d1f93d4 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -7276,6 +7276,7 @@ merge(Compressor.prototype, { } function retain_lhs(node) { + if (node instanceof AST_DefaultValue) return retain_lhs(node.name); if (node instanceof AST_Destructured) { if (value === null) { value = make_node(AST_Number, node, { value: 0 }); @@ -7289,7 +7290,6 @@ merge(Compressor.prototype, { } return make_node(AST_DestructuredObject, node, { properties: [] }); } - if (node instanceof AST_DefaultValue) node = node.name; node.__unused = null; return node; } -- cgit v1.2.3