@@ -1937,7 +1937,7 @@ merge(Compressor.prototype, {
|
|||||||
if (self.cdr instanceof AST_UnaryPrefix
|
if (self.cdr instanceof AST_UnaryPrefix
|
||||||
&& self.cdr.operator == "void"
|
&& self.cdr.operator == "void"
|
||||||
&& !self.cdr.expression.has_side_effects(compressor)) {
|
&& !self.cdr.expression.has_side_effects(compressor)) {
|
||||||
self.cdr.operator = self.car;
|
self.cdr.expression = self.car;
|
||||||
return self.cdr;
|
return self.cdr;
|
||||||
}
|
}
|
||||||
if (self.cdr instanceof AST_Undefined) {
|
if (self.cdr instanceof AST_Undefined) {
|
||||||
|
|||||||
21
test/compress/issue-611.js
Normal file
21
test/compress/issue-611.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
issue_611: {
|
||||||
|
options = {
|
||||||
|
sequences: true,
|
||||||
|
side_effects: true
|
||||||
|
};
|
||||||
|
input: {
|
||||||
|
define(function() {
|
||||||
|
function fn() {}
|
||||||
|
if (fn()) {
|
||||||
|
fn();
|
||||||
|
return void 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
define(function() {
|
||||||
|
function fn(){}
|
||||||
|
if (fn()) return void fn();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user