remove IfStatement making consequent and alternate blocks
This commit is contained in:
parent
3cd7ed69a3
commit
e13a650d05
@ -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 () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user