generator: add alternate support to IfStatement

This commit is contained in:
Sebastian McKenzie 2014-11-01 17:52:48 +11:00
parent 1d3544eadc
commit a5523664fc

View File

@ -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) {