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

Commit 69a0ffa

Browse files
committed
Fix: Set await property on async iterators (for await) (fixes #236)
1 parent a294afa commit 69a0ffa

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
@@ -899,11 +899,15 @@ module.exports = function(ast, extra) {
899899

900900
case SyntaxKind.ForInStatement:
901901
case SyntaxKind.ForOfStatement:
902+
var isAwait = node.awaitModifier
903+
&& node.awaitModifier.kind === ts.SyntaxKind.AwaitKeyword;
904+
902905
assign(result, {
903906
type: SyntaxKind[node.kind],
904907
left: convertChild(node.initializer),
905908
right: convertChild(node.expression),
906-
body: convertChild(node.statement)
909+
body: convertChild(node.statement),
910+
await: isAwait
907911
});
908912
break;
909913

0 commit comments

Comments
 (0)