@@ -22501,19 +22501,17 @@ namespace ts {
22501
22501
function checkForOfStatement(node: ForOfStatement): void {
22502
22502
checkGrammarForInOrForOfStatement(node);
22503
22503
22504
- if (node.kind === SyntaxKind.ForOfStatement) {
22505
- if (node.awaitModifier) {
22506
- const functionFlags = getFunctionFlags(getContainingFunction(node));
22507
- if ((functionFlags & (FunctionFlags.Invalid | FunctionFlags.Async)) === FunctionFlags.Async && languageVersion < ScriptTarget.ESNext) {
22508
- // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper
22509
- checkExternalEmitHelpers(node, ExternalEmitHelpers.ForAwaitOfIncludes);
22510
- }
22511
- }
22512
- else if (compilerOptions.downlevelIteration && languageVersion < ScriptTarget.ES2015) {
22513
- // for..of prior to ES2015 requires the __values helper when downlevelIteration is enabled
22514
- checkExternalEmitHelpers(node, ExternalEmitHelpers.ForOfIncludes);
22504
+ if (node.awaitModifier) {
22505
+ const functionFlags = getFunctionFlags(getContainingFunction(node));
22506
+ if ((functionFlags & (FunctionFlags.Invalid | FunctionFlags.Async)) === FunctionFlags.Async && languageVersion < ScriptTarget.ESNext) {
22507
+ // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper
22508
+ checkExternalEmitHelpers(node, ExternalEmitHelpers.ForAwaitOfIncludes);
22515
22509
}
22516
22510
}
22511
+ else if (compilerOptions.downlevelIteration && languageVersion < ScriptTarget.ES2015) {
22512
+ // for..of prior to ES2015 requires the __values helper when downlevelIteration is enabled
22513
+ checkExternalEmitHelpers(node, ExternalEmitHelpers.ForOfIncludes);
22514
+ }
22517
22515
22518
22516
// Check the LHS and RHS
22519
22517
// If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS
0 commit comments