aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-05 18:11:30 +0000
committerGitHub <noreply@github.com>2021-01-06 02:11:30 +0800
commit71c3d04681b5f77799d426547be9646f25f44abc (patch)
treef4dafef943dd38b6fed2c5a016fc3081a6cfdcf9 /lib
parent4c89550c43974d5d570f132b2d8bc105c05cc618 (diff)
downloadtracifyjs-71c3d04681b5f77799d426547be9646f25f44abc.tar.gz
tracifyjs-71c3d04681b5f77799d426547be9646f25f44abc.zip
fix corner case in `side_effects` (#4513)
fixes #4512
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/compress.js b/lib/compress.js
index dcb2cc4c..b1389253 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -8073,15 +8073,7 @@ merge(Compressor.prototype, {
}
if (argname instanceof AST_Destructured) {
has_destructured = true;
- var abort = false;
- argname.walk(new TreeWalker(function(node) {
- if (abort) return true;
- if (node instanceof AST_DestructuredKeyVal) {
- var key = node.key;
- if (key instanceof AST_Node && has_arg_refs(key)) return abort = true;
- }
- }));
- if (abort) return false;
+ if (has_arg_refs(argname)) return false;
}
return true;
});