Merge 94ef5ed8bb into 102d1b9137
This commit is contained in:
commit
096833bc07
|
|
@ -596,7 +596,7 @@ function OutputStream(options) {
|
||||||
|
|
||||||
PARENS(AST_Number, function(output){
|
PARENS(AST_Number, function(output){
|
||||||
var p = output.parent();
|
var p = output.parent();
|
||||||
if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this)
|
if (p instanceof AST_PropAccess && p.expression === this && (this.getValue() < 0 || make_num(this.getValue()).match(/^0/)))
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1026,7 +1026,7 @@ function OutputStream(options) {
|
||||||
var expr = self.expression;
|
var expr = self.expression;
|
||||||
expr.print(output);
|
expr.print(output);
|
||||||
if (expr instanceof AST_Number && expr.getValue() >= 0) {
|
if (expr instanceof AST_Number && expr.getValue() >= 0) {
|
||||||
if (!/[xa-f.]/i.test(output.last())) {
|
if (!/[xa-f.)]/i.test(output.last())) {
|
||||||
output.print(".");
|
output.print(".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
test/compress/numbers.js
Normal file
16
test/compress/numbers.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
hex_numbers_in_parentheses_for_prototype_functions: {
|
||||||
|
input: {
|
||||||
|
(-2);
|
||||||
|
(-2).toFixed(0);
|
||||||
|
|
||||||
|
(2);
|
||||||
|
(2).toFixed(0);
|
||||||
|
|
||||||
|
(0.00000002);
|
||||||
|
(0.00000002).toFixed(0);
|
||||||
|
|
||||||
|
(1000000000000000128);
|
||||||
|
(1000000000000000128).toFixed(0);
|
||||||
|
}
|
||||||
|
expect_exact: "-2;(-2).toFixed(0);2;2..toFixed(0);2e-8;2e-8.toFixed(0);0xde0b6b3a7640080;(0xde0b6b3a7640080).toFixed(0);"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user