aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-02-06 11:38:29 +0200
committerMihai Bazon <mihai@bazon.net>2013-02-06 11:38:29 +0200
commitfdf8b5eb71f762c6a021775609a6333ed110f17b (patch)
treebb9a2115521e62903db6c8b32f8e05b562309c0b
parentde7ec7f1b7e387f933daef7ef035583a8ca8b715 (diff)
downloadtracifyjs-fdf8b5eb71f762c6a021775609a6333ed110f17b.tar.gz
tracifyjs-fdf8b5eb71f762c6a021775609a6333ed110f17b.zip
Fix parens for NaN
Close #116
-rw-r--r--lib/output.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js
index ab9b82b4..b33bc634 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -520,6 +520,12 @@ function OutputStream(options) {
return true;
});
+ PARENS(AST_NaN, function(output){
+ var p = output.parent();
+ if (p instanceof AST_PropAccess && p.expression === this)
+ return true;
+ });
+
function assign_and_conditional_paren_rules(output) {
var p = output.parent();
// !(a = false) → true