@@ -4330,6 +4330,7 @@ merge(Compressor.prototype, {
|
||||
if (ignore_side_effects) {
|
||||
fn.walk(scan_modified);
|
||||
var found = false;
|
||||
fn.evaluating = true;
|
||||
walk_body(fn, new TreeWalker(function(node) {
|
||||
if (found) return true;
|
||||
if (node instanceof AST_Return) {
|
||||
@@ -4340,6 +4341,7 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
if (node instanceof AST_Scope && node !== fn) return true;
|
||||
}));
|
||||
delete fn.evaluating;
|
||||
if (!found) return;
|
||||
}
|
||||
return this;
|
||||
@@ -4999,6 +5001,7 @@ merge(Compressor.prototype, {
|
||||
var stat = self.body[i];
|
||||
if (stat instanceof AST_Directive) continue;
|
||||
if (stat instanceof AST_Return) {
|
||||
if (i != self.body.length - 1) break;
|
||||
var call = stat.value;
|
||||
if (!call || call.TYPE != "Call") break;
|
||||
if (call.is_expr_pure(compressor)) break;
|
||||
@@ -8323,9 +8326,12 @@ merge(Compressor.prototype, {
|
||||
return parent ? maintain_this_binding(compressor, parent, node, arg) : arg;
|
||||
}
|
||||
})));
|
||||
var save_inlined = fn.inlined;
|
||||
if (exp !== fn) fn.inlined = true;
|
||||
var node = make_sequence(self, args.filter(function(arg) {
|
||||
return arg;
|
||||
})).optimize(compressor);
|
||||
fn.inlined = save_inlined;
|
||||
node = maintain_this_binding(compressor, compressor.parent(), compressor.self(), node);
|
||||
if (replacing || best_of_expression(node, self) === node) {
|
||||
refs.forEach(function(ref) {
|
||||
@@ -9788,8 +9794,8 @@ merge(Compressor.prototype, {
|
||||
single_use = fixed.is_constant_expression(self.scope);
|
||||
if (single_use == "f") {
|
||||
var scope = self.scope;
|
||||
do if (is_defun(scope) || is_function(scope)) {
|
||||
scope.inlined = true;
|
||||
do {
|
||||
if (is_defun(scope) || is_function(scope)) scope.inlined = true;
|
||||
} while (scope = scope.parent_scope);
|
||||
}
|
||||
} else if (fixed.name && fixed.name.name == "await" && is_async(fixed)) {
|
||||
|
||||
Reference in New Issue
Block a user