fix WithStatement missing paranthesis

This commit is contained in:
Sebastian McKenzie 2014-11-14 00:54:58 +11:00
parent 5eb2462e29
commit 6963cc1e40

View File

@ -4,6 +4,7 @@ exports.WithStatement = function (node, print) {
this.keyword("with"); this.keyword("with");
this.push("("); this.push("(");
print(node.object); print(node.object);
this.push(")");
print.block(node.body); print.block(node.body);
}; };
@ -134,15 +135,6 @@ exports.SwitchStatement = function (node, print) {
this.push(") {"); this.push(") {");
print.sequence(node.cases, { indent: true }); print.sequence(node.cases, { indent: true });
this.push("}"); 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) { exports.SwitchCase = function (node, print) {
@ -154,13 +146,8 @@ exports.SwitchCase = function (node, print) {
this.push("default:"); this.push("default:");
} }
if (node.consequent.length === 1) {
this.space(); this.space();
print(node.consequent[0]);
} else if (node.consequent.length > 1) {
this.newline();
print.sequence(node.consequent, { indent: true }); print.sequence(node.consequent, { indent: true });
}
}; };
exports.DebuggerStatement = function () { exports.DebuggerStatement = function () {