generator: add alternate support to IfStatement
This commit is contained in:
parent
1d3544eadc
commit
a5523664fc
@ -14,6 +14,12 @@ exports.IfStatement = function (node, print) {
|
||||
print(node.test);
|
||||
this.push(") ");
|
||||
print(node.consequent);
|
||||
|
||||
if (node.alternate) {
|
||||
if (this.isLast("}")) this.push(" ");
|
||||
this.keyword("else");
|
||||
print(node.alternate);
|
||||
}
|
||||
};
|
||||
|
||||
exports.BlockStatement = function (node, print) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user