@@ -4404,9 +4404,15 @@ Compressor.prototype.compress = function(node) {
|
||||
def(AST_Sequence, function(compressor) {
|
||||
return this.tail_node().is_number(compressor);
|
||||
});
|
||||
def(AST_SymbolRef, function(compressor) {
|
||||
def(AST_SymbolRef, function(compressor, keep_unary) {
|
||||
var fixed = this.fixed_value();
|
||||
if (!fixed) return false;
|
||||
if (keep_unary
|
||||
&& fixed instanceof AST_UnaryPrefix
|
||||
&& fixed.operator == "+"
|
||||
&& fixed.expression.equivalent_to(this)) {
|
||||
return false;
|
||||
}
|
||||
this.is_number = return_false;
|
||||
var result = fixed.is_number(compressor);
|
||||
delete this.is_number;
|
||||
@@ -10772,7 +10778,7 @@ Compressor.prototype.compress = function(node) {
|
||||
}
|
||||
switch (op) {
|
||||
case "+":
|
||||
if (compressor.option("evaluate") && exp.is_number(compressor)) return exp;
|
||||
if (compressor.option("evaluate") && exp.is_number(compressor, true)) return exp;
|
||||
break;
|
||||
case "-":
|
||||
if (exp instanceof AST_Infinity) exp = exp.transform(compressor);
|
||||
|
||||
Reference in New Issue
Block a user