});
def(AST_SimpleStatement, function(){
- if (this.body instanceof AST_Function) return false;
return this.body.has_side_effects();
});
+ def(AST_Defun, function(){ return true });
+ def(AST_Function, function(){ return false });
def(AST_Binary, function(){
return this.left.has_side_effects()
|| this.right.has_side_effects();
if (compressor.option("side_effects")) {
if (self.expression instanceof AST_Function
&& self.args.length == 0
- && !self.expression.has_side_effects()) {
+ && !AST_Block.prototype.has_side_effects.call(self.expression)) {
return make_node(AST_Undefined, self).transform(compressor);
}
}