@@ -668,6 +668,7 @@ merge(Compressor.prototype, {
|
||||
function can_be_evicted_from_block(node) {
|
||||
return !(
|
||||
node instanceof AST_DefClass ||
|
||||
node instanceof AST_Defun ||
|
||||
node instanceof AST_Let ||
|
||||
node instanceof AST_Const
|
||||
);
|
||||
@@ -1997,7 +1998,8 @@ merge(Compressor.prototype, {
|
||||
self.body = tighten_body(self.body, compressor);
|
||||
switch (self.body.length) {
|
||||
case 1:
|
||||
if (can_be_evicted_from_block(self.body[0])) {
|
||||
if (!compressor.has_directive("use strict") && compressor.parent() instanceof AST_If
|
||||
|| can_be_evicted_from_block(self.body[0])) {
|
||||
return self.body[0];
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user