make sure classes don't have their surrounding blocks removed too
This commit is contained in:
parent
55acf310f8
commit
f4e1a23de7
|
|
@ -3118,7 +3118,8 @@ merge(Compressor.prototype, {
|
|||
function can_be_extracted_from_if_block(node) {
|
||||
return !(
|
||||
node instanceof AST_Const ||
|
||||
node instanceof AST_Let
|
||||
node instanceof AST_Let ||
|
||||
node instanceof AST_Class
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -200,6 +200,11 @@ issue_2946_else_const: {
|
|||
} else {
|
||||
let w = 48;
|
||||
}
|
||||
if (3) {
|
||||
class X {}
|
||||
} else {
|
||||
class Y {}
|
||||
}
|
||||
}
|
||||
expect: {
|
||||
if (1) {
|
||||
|
|
@ -212,5 +217,10 @@ issue_2946_else_const: {
|
|||
} else {
|
||||
let w = 48;
|
||||
}
|
||||
if (3) {
|
||||
class X {}
|
||||
} else {
|
||||
class Y {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user