added AST_NaN (output as 0/0)
This commit is contained in:
@@ -526,9 +526,9 @@ function Compressor(options, false_by_default) {
|
||||
});
|
||||
break;
|
||||
case "number":
|
||||
ast = make_node(AST_Number, this, {
|
||||
ast = make_node(isNaN(val) ? AST_NaN : AST_Number, this, {
|
||||
value: val
|
||||
});
|
||||
}).optimize(compressor);
|
||||
break;
|
||||
case "boolean":
|
||||
ast = make_node(val ? AST_True : AST_False, this);
|
||||
@@ -1501,8 +1501,11 @@ function Compressor(options, false_by_default) {
|
||||
});
|
||||
|
||||
AST_SymbolRef.DEFMETHOD("optimize", function(compressor){
|
||||
if (this.name == "undefined" && this.undeclared()) {
|
||||
if (this.undeclared()) switch (this.name) {
|
||||
case "undefined":
|
||||
return make_node(AST_Undefined, this).optimize(compressor);
|
||||
case "NaN":
|
||||
return make_node(AST_NaN, this).optimize(compressor);
|
||||
}
|
||||
return this;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user