fix corner case in dead_code (#4981)
This commit is contained in:
@@ -3638,11 +3638,17 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
|
||||
function extract_declarations_from_unreachable_code(compressor, stat, target) {
|
||||
if (!(stat instanceof AST_Definitions || stat instanceof AST_LambdaDefinition)) {
|
||||
if (!(stat instanceof AST_DefClass
|
||||
|| stat instanceof AST_Definitions
|
||||
|| stat instanceof AST_LambdaDefinition)) {
|
||||
AST_Node.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
||||
}
|
||||
var block;
|
||||
stat.walk(new TreeWalker(function(node, descend) {
|
||||
if (node instanceof AST_DefClass) {
|
||||
push(node);
|
||||
return true;
|
||||
}
|
||||
if (node instanceof AST_Definitions) {
|
||||
var defns = [];
|
||||
if (node.remove_initializers(compressor, defns)) {
|
||||
|
||||
Reference in New Issue
Block a user