From b1fe449b0d03e81d1ca46f81eef7eb454605291e Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 14 Nov 2014 00:53:45 +1100 Subject: [PATCH] allow XJSElement and SequenceExpression to be user whitespacable --- lib/6to5/generation/node/index.js | 9 +++------ lib/6to5/types/alias-keys.json | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/6to5/generation/node/index.js b/lib/6to5/generation/node/index.js index 240036513e..68f6bc1f82 100644 --- a/lib/6to5/generation/node/index.js +++ b/lib/6to5/generation/node/index.js @@ -24,17 +24,14 @@ function Node(node, parent) { } Node.prototype.isUserWhitespacable = function () { - //var parent = this.parent; + var parent = this.parent; var node = this.node; - if (t.isUserWhitespacable(node)) { + if (t.isUserWhitespacable(node) || + t.isSequenceExpression(parent)) { return true; } - //if (t.isArrayExpression(parent)) { - // return true; - //} - return false; }; diff --git a/lib/6to5/types/alias-keys.json b/lib/6to5/types/alias-keys.json index 55a5af6e65..b2f4aef530 100644 --- a/lib/6to5/types/alias-keys.json +++ b/lib/6to5/types/alias-keys.json @@ -42,5 +42,6 @@ "ObjectPattern": ["Pattern"], "ArrayPattern": ["Pattern"], - "Property": ["UserWhitespacable"] + "Property": ["UserWhitespacable"], + "XJSElement": ["UserWhitespacable"] }