Fix loop labels for for..await

This commit is contained in:
Ron Buckton
2018-01-25 02:11:01 -08:00
parent 3a807db8ee
commit 5698a6ab52
17 changed files with 701 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ namespace ts {
}
function visitLabeledStatement(node: LabeledStatement) {
if (enclosingFunctionFlags & FunctionFlags.Async && enclosingFunctionFlags & FunctionFlags.Generator) {
if (enclosingFunctionFlags & FunctionFlags.Async) {
const statement = unwrapInnermostStatementOfLabel(node);
if (statement.kind === SyntaxKind.ForOfStatement && (<ForOfStatement>statement).awaitModifier) {
return visitForOfStatement(<ForOfStatement>statement, node);