diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/output.js b/lib/output.js index dceece34..a8c45a0f 100644 --- a/lib/output.js +++ b/lib/output.js @@ -596,8 +596,12 @@ function OutputStream(options) { PARENS(AST_Number, function(output){ var p = output.parent(); - if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this) - return true; + if (p instanceof AST_PropAccess && p.expression === this) { + var value = this.getValue(); + if (value < 0 || /^0/.test(make_num(value))) { + return true; + } + } }); PARENS([ AST_Assign, AST_Conditional ], function (output){ @@ -1026,7 +1030,7 @@ function OutputStream(options) { var expr = self.expression; expr.print(output); if (expr instanceof AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.]/i.test(output.last())) { + if (!/[xa-f.)]/i.test(output.last())) { output.print("."); } } |