aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-30 17:47:00 +0000
committerGitHub <noreply@github.com>2020-12-31 01:47:00 +0800
commit8b954b022bf206048f8380878251bd64795da5f9 (patch)
tree31d7ca925c3f47982c672cef70799e204dc60822 /lib/compress.js
parent0013cbf91f5a833eb51e3473ef2f18844f722ae9 (diff)
downloadtracifyjs-8b954b022bf206048f8380878251bd64795da5f9.tar.gz
tracifyjs-8b954b022bf206048f8380878251bd64795da5f9.zip
fix corner case with default values (#4484)
fixes #4483
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3ac9e74d..aea3155a 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3603,6 +3603,7 @@ merge(Compressor.prototype, {
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;