minor clean up (#4069)

This commit is contained in:
Alex Lam S.L
2020-08-25 10:10:56 +08:00
committed by GitHub
parent 0eb0c9b388
commit 1caf7c7bd2
3 changed files with 24 additions and 52 deletions

View File

@@ -7185,11 +7185,11 @@ merge(Compressor.prototype, {
var parent = compressor.parent();
if (compressor.option("comparisons") && self.is_boolean(compressor)) {
if (!(parent instanceof AST_Binary) || parent instanceof AST_Assign) {
var negated = make_node(AST_UnaryPrefix, self, {
var negated = best_of(compressor, self, make_node(AST_UnaryPrefix, self, {
operator: "!",
expression: self.negate(compressor, first_in_statement(compressor))
});
self = best_of(compressor, self, negated);
}));
if (negated !== self) return negated;
}
switch (self.operator) {
case ">": reverse("<"); break;
@@ -7659,7 +7659,7 @@ merge(Compressor.prototype, {
}
function is_indexFn(node) {
return node instanceof AST_Call
return node.TYPE == "Call"
&& node.expression instanceof AST_Dot
&& indexFns[node.expression.property];
}