fix missing parentheses around NaN/Infinity shorthands (#1726)

fixes #1724
fixes #1725
This commit is contained in:
Alex Lam S.L
2017-03-29 20:53:03 +08:00
committed by GitHub
parent 09f77c7d4d
commit 2e41cd6394
2 changed files with 27 additions and 1 deletions

View File

@@ -596,7 +596,9 @@ function OutputStream(options) {
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 != "-";
|| p instanceof AST_Unary && p.operator != "+" && p.operator != "-"
|| p instanceof AST_Binary && p.right === this
&& (p.operator == "/" || p.operator == "%");
});
PARENS(AST_Seq, function(output){