From e13a650d05eb52e0939c373776e1feff2662832c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 3 Nov 2014 11:17:36 +1100 Subject: [PATCH] remove IfStatement making consequent and alternate blocks --- lib/6to5/generators/statements.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/6to5/generators/statements.js b/lib/6to5/generators/statements.js index 4e32b73123..fc6a511494 100644 --- a/lib/6to5/generators/statements.js +++ b/lib/6to5/generators/statements.js @@ -15,14 +15,12 @@ exports.IfStatement = function (node, print) { print(node.test); this.push(") "); - var consequent = node.consequent; - if (node.alternate) consequent = t.toBlock(consequent); - print(consequent); + print(node.consequent); if (node.alternate) { if (this.isLast("}")) this.push(" "); this.keyword("else"); - print(t.toBlock(node.alternate)); + print(node.alternate); } }; @@ -159,15 +157,13 @@ exports.SwitchCase = function (node, print) { this.push("default:"); } - this.indent(); if (node.consequent.length === 1) { this.push(" "); print(node.consequent[0]); } else if (node.consequent.length > 1) { this.newline(); - print.sequence(node.consequent); + print.sequence(node.consequent, { indent: true }); } - this.dedent(); }; exports.DebuggerStatement = function () {