if_return : !false_by_default,
join_vars : !false_by_default,
cascade : !false_by_default,
+ side_effects : !false_by_default,
warnings : true,
global_defs : {}
});
OPT(AST_SimpleStatement, function(self, compressor){
- if (!self.body.has_side_effects()) {
- compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start);
- return make_node(AST_EmptyStatement, self);
+ if (compressor.option("side_effects")) {
+ if (!self.body.has_side_effects()) {
+ compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start);
+ return make_node(AST_EmptyStatement, self);
+ }
}
return self;
});
operator: "&&",
left: self.condition,
right: self.body.condition
- });
+ }).transform(compressor);
self.body = self.body.body;
}
if (aborts(self.body)) {