diff options
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/output.js b/lib/output.js index 5c11088b..d71f6aac 100644 --- a/lib/output.js +++ b/lib/output.js @@ -592,6 +592,13 @@ function OutputStream(options) { || p instanceof AST_Call && p.expression === this; }); + PARENS([ AST_Infinity, AST_NaN ], function(output){ + var p = output.parent(); + return p instanceof AST_PropAccess && p.expression === this + || p instanceof AST_Call && p.expression === this + || p instanceof AST_Unary && p.operator != "+" && p.operator != "-"; + }); + PARENS(AST_Seq, function(output){ var p = output.parent(); return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) @@ -1254,10 +1261,18 @@ function OutputStream(options) { }); DEFPRINT(AST_Hole, noop); DEFPRINT(AST_Infinity, function(self, output){ - output.print("Infinity"); + output.print("1"); + output.space(); + output.print("/"); + output.space(); + output.print("0"); }); DEFPRINT(AST_NaN, function(self, output){ - output.print("NaN"); + output.print("0"); + output.space(); + output.print("/"); + output.space(); + output.print("0"); }); DEFPRINT(AST_This, function(self, output){ output.print("this"); |