From 6963cc1e4087b10c80b460b2fcbd15d6d672ef01 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 14 Nov 2014 00:54:58 +1100 Subject: [PATCH] fix WithStatement missing paranthesis --- lib/6to5/generation/generators/statements.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/lib/6to5/generation/generators/statements.js b/lib/6to5/generation/generators/statements.js index 6306c3ef87..f96ecb29fa 100644 --- a/lib/6to5/generation/generators/statements.js +++ b/lib/6to5/generation/generators/statements.js @@ -4,6 +4,7 @@ exports.WithStatement = function (node, print) { this.keyword("with"); this.push("("); print(node.object); + this.push(")"); print.block(node.body); }; @@ -134,15 +135,6 @@ exports.SwitchStatement = function (node, print) { this.push(") {"); print.sequence(node.cases, { indent: true }); this.push("}"); - - //if (node.cases.length) { - // this.newline(); - // print.sequence(node.cases, { indent: true }); - // this.newline(); - // this.rightBrace(); - //} else { - // this.push("}"); - //} }; exports.SwitchCase = function (node, print) { @@ -154,13 +146,8 @@ exports.SwitchCase = function (node, print) { this.push("default:"); } - if (node.consequent.length === 1) { - this.space(); - print(node.consequent[0]); - } else if (node.consequent.length > 1) { - this.newline(); - print.sequence(node.consequent, { indent: true }); - } + this.space(); + print.sequence(node.consequent, { indent: true }); }; exports.DebuggerStatement = function () {