convert to number under boolean context (#2545)
This commit is contained in:
@@ -4699,6 +4699,9 @@ merge(Compressor.prototype, {
|
||||
});
|
||||
|
||||
OPT(AST_Boolean, function(self, compressor){
|
||||
if (compressor.in_boolean_context()) return make_node(AST_Number, self, {
|
||||
value: +self.value
|
||||
});
|
||||
if (compressor.option("booleans")) {
|
||||
var p = compressor.parent();
|
||||
if (p instanceof AST_Binary && (p.operator == "=="
|
||||
|
||||
Reference in New Issue
Block a user