@@ -2760,10 +2760,12 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (exp instanceof AST_Function) {
|
if (exp instanceof AST_Function) {
|
||||||
if (exp.body[0] instanceof AST_Return
|
if (exp.body[0] instanceof AST_Return) {
|
||||||
&& exp.body[0].value.is_constant()) {
|
var value = exp.body[0].value;
|
||||||
var args = self.args.concat(exp.body[0].value);
|
if (!value || value.is_constant()) {
|
||||||
return AST_Seq.from_array(args).transform(compressor);
|
var args = self.args.concat(value || make_node(AST_Undefined, self));
|
||||||
|
return AST_Seq.from_array(args).transform(compressor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (compressor.option("side_effects")) {
|
if (compressor.option("side_effects")) {
|
||||||
if (!AST_Block.prototype.has_side_effects.call(exp, compressor)) {
|
if (!AST_Block.prototype.has_side_effects.call(exp, compressor)) {
|
||||||
|
|||||||
@@ -74,3 +74,20 @@ iifes_returning_constants_keep_fargs_false: {
|
|||||||
console.log((a(), b(), 6));
|
console.log((a(), b(), 6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_485_crashing_1530: {
|
||||||
|
options = {
|
||||||
|
conditionals: true,
|
||||||
|
dead_code: true,
|
||||||
|
evaluate: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function(a) {
|
||||||
|
if (true) return;
|
||||||
|
var b = 42;
|
||||||
|
})(this);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
this, void 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user