@@ -3567,7 +3567,7 @@ Compressor.prototype.compress = function(node) {
|
||||
continue;
|
||||
}
|
||||
// if (foo()) return bar() ? x : void 0; ---> return foo() && bar() ? x : void 0;
|
||||
// if (foo()) return bar() ? void 0 : x; ---> return foo() || bar() ? void 0 : x;
|
||||
// if (foo()) return bar() ? void 0 : x; ---> return !foo() || bar() ? void 0 : x;
|
||||
var or;
|
||||
if (value instanceof AST_Conditional
|
||||
&& ((or = is_undefined(value.consequent, compressor))
|
||||
@@ -3577,7 +3577,7 @@ Compressor.prototype.compress = function(node) {
|
||||
ret.value = value.clone();
|
||||
ret.value.condition = make_node(AST_Binary, stat, {
|
||||
operator: or ? "||" : "&&",
|
||||
left: stat.condition,
|
||||
left: or ? stat.condition.negate(compressor) : stat.condition,
|
||||
right: value.condition,
|
||||
});
|
||||
statements.splice(i, 1, ret.transform(compressor));
|
||||
|
||||
Reference in New Issue
Block a user