diff --git a/lib/6to5/generators/methods.js b/lib/6to5/generators/methods.js index e35d329622..d741ffb75e 100644 --- a/lib/6to5/generators/methods.js +++ b/lib/6to5/generators/methods.js @@ -49,6 +49,7 @@ exports._method = function (node, print) { } this._params(value, print); + this.push(" "); print(value.body); }; diff --git a/lib/6to5/generators/statements.js b/lib/6to5/generators/statements.js index fc6a511494..12365f439e 100644 --- a/lib/6to5/generators/statements.js +++ b/lib/6to5/generators/statements.js @@ -5,8 +5,7 @@ exports.WithStatement = function (node, print) { this.keyword("with"); this.push("("); print(node.object); - this.push(") "); - print(node.body); + this.printBlock(print, node.body); }; exports.IfStatement = function (node, print) { @@ -42,17 +41,16 @@ exports.ForStatement = function (node, print) { print(node.update); } - this.push(") "); - - print(node.body); + this.push(")"); + this.printBlock(print, node.body); }; exports.WhileStatement = function (node, print) { this.keyword("while"); this.push("("); print(node.test); - this.push(") "); - print(node.body); + this.push(")"); + this.printBlock(print, node.body); }; exports.ForInStatement = function (node, print) { @@ -61,8 +59,8 @@ exports.ForInStatement = function (node, print) { print(node.left); this.push(" in "); print(node.right); - this.push(") "); - print(node.body); + this.push(")"); + this.printBlock(print, node.body); }; exports.ForOfStatement = function (node, print) { @@ -72,7 +70,7 @@ exports.ForOfStatement = function (node, print) { this.push(" of "); print(node.right); this.push(")"); - print(node.body); + this.printBlock(print, node.body); }; exports.DoWhileStatement = function (node, print) {