Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit d30cc2f

Browse files
committed
Fix: Set await property on async iterators (for await) nodes (fixes #236)
1 parent 9f44854 commit d30cc2f

File tree

3 files changed

+506
-1
lines changed

3 files changed

+506
-1
lines changed

lib/ast-converter.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -892,11 +892,15 @@ module.exports = function(ast, extra) {
892892

893893
case SyntaxKind.ForInStatement:
894894
case SyntaxKind.ForOfStatement:
895+
var isAwait = node.awaitModifier
896+
&& node.awaitModifier.kind === ts.SyntaxKind.AwaitKeyword;
897+
895898
assign(result, {
896899
type: SyntaxKind[node.kind],
897900
left: convertChild(node.initializer),
898901
right: convertChild(node.expression),
899-
body: convertChild(node.statement)
902+
body: convertChild(node.statement),
903+
await: isAwait
900904
});
901905
break;
902906

0 commit comments

Comments
 (0)