From e4a1e491f6fba7913ac5eba45a39213f8d1ff500 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 29 Jul 2015 23:25:45 +0100 Subject: [PATCH] flip around conditional - i hate this style --- packages/babel/src/generation/generators/types.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/babel/src/generation/generators/types.js b/packages/babel/src/generation/generators/types.js index 92bd234055..32884649dd 100644 --- a/packages/babel/src/generation/generators/types.js +++ b/packages/babel/src/generation/generators/types.js @@ -102,17 +102,17 @@ export function ArrayExpression(node, print) { for (var i = 0; i < elems.length; i++) { var elem = elems[i]; - if (!elem) { + if (elem) { + if (i > 0) this.space(); + print.plain(elem); + if (i < len - 1) this.push(","); + } else { // If the array expression ends with a hole, that hole // will be ignored by the interpreter, but if it ends with // two (or more) holes, we need to write out two (or more) // commas so that the resulting code is interpreted with // both (all) of the holes. this.push(","); - } else { - if (i > 0) this.space(); - print.plain(elem); - if (i < len - 1) this.push(","); } }