@@ -1249,7 +1249,14 @@ merge(Compressor.prototype, {
|
||||
return true;
|
||||
}
|
||||
if (node instanceof AST_Defun && (node === stat || !compressor.has_directive("use strict"))) {
|
||||
target.push(node);
|
||||
target.push(node === stat ? node : make_node(AST_Var, node, {
|
||||
definitions: [
|
||||
make_node(AST_VarDef, node, {
|
||||
name: make_node(AST_SymbolVar, node.name, node.name),
|
||||
value: null
|
||||
})
|
||||
]
|
||||
}));
|
||||
return true;
|
||||
}
|
||||
if (node instanceof AST_Scope) {
|
||||
@@ -2388,7 +2395,7 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
if (hoist_funs && node instanceof AST_Defun
|
||||
&& !(tt.parent() instanceof AST_Export)
|
||||
&& (tt.parent() === self || !compressor.has_directive("use strict"))) {
|
||||
&& tt.parent() === self) {
|
||||
hoisted.push(node);
|
||||
return make_node(AST_EmptyStatement, node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user