add AwaitExpression generator

This commit is contained in:
Sebastian McKenzie
2014-11-11 13:05:07 +11:00
parent d9a3eadad7
commit 5ae4f8eec7

View File

@@ -64,15 +64,20 @@ exports.CallExpression = function (node, print) {
this.push(")");
};
exports.YieldExpression = function (node, print) {
this.push("yield");
if (node.delegate) this.push("*");
if (node.argument) {
this.space();
print(node.argument);
}
var buildYieldAwait = function (keyword) {
return function (node, print) {
this.push(keyword);
if (node.delegate) this.push("*");
if (node.argument) {
this.space();
print(node.argument);
}
};
};
exports.YieldExpression = buildYieldAwait("yield");
exports.AwaitExpression = buildYieldAwait("await");
exports.EmptyStatement = function () {
this.semicolon();
};