aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-19 00:34:55 +0000
committerGitHub <noreply@github.com>2020-11-19 08:34:55 +0800
commit134ef0b1eb5e7ec0fc02e3aa0f36e319b4b82ac4 (patch)
treeb815d719af7dc5d56f5f5508f5b39778eb03c0fd /lib
parentdb87dcf13e69cecd0f6153f65ab9aab81cffd574 (diff)
downloadtracifyjs-134ef0b1eb5e7ec0fc02e3aa0f36e319b4b82ac4.tar.gz
tracifyjs-134ef0b1eb5e7ec0fc02e3aa0f36e319b4b82ac4.zip
fix corner case in `dead_code` (#4304)
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index acd15f5e..f5dd73cc 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -7027,7 +7027,8 @@ merge(Compressor.prototype, {
OPT(AST_Try, function(self, compressor) {
self.body = tighten_body(self.body, compressor);
if (compressor.option("dead_code")) {
- if (has_declarations_only(self)) {
+ if (has_declarations_only(self)
+ && !(self.bcatch && self.bcatch.argname && !can_drop_symbol(self.bcatch.argname))) {
var body = [];
if (self.bcatch) {
extract_declarations_from_unreachable_code(compressor, self.bcatch, body);