aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-13 16:03:44 +0000
committerGitHub <noreply@github.com>2020-12-14 00:03:44 +0800
commitfcc40d0502a29e09a164ca04603db33b7dedfc3c (patch)
treea79473815b3d9c98ec0c7647b9dd361a9e18f14a /lib
parentb309527264ff7aea380df98021133bb3ff591a2d (diff)
downloadtracifyjs-fcc40d0502a29e09a164ca04603db33b7dedfc3c.tar.gz
tracifyjs-fcc40d0502a29e09a164ca04603db33b7dedfc3c.zip
fix corner case in `dead_code` (#4378)
fixes #4377
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index db91155c..3e70f2eb 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3016,7 +3016,7 @@ merge(Compressor.prototype, {
}
function extract_declarations_from_unreachable_code(compressor, stat, target) {
- if (!(stat instanceof AST_Definitions || stat instanceof AST_Defun)) {
+ if (!(stat instanceof AST_Definitions || is_defun(stat))) {
AST_Node.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
}
var block;
@@ -3032,7 +3032,7 @@ merge(Compressor.prototype, {
}
return true;
}
- if (node instanceof AST_Defun) {
+ if (is_defun(node)) {
push(node);
return true;
}