Skip to content

Commit 57e28df

Browse files
author
Andy
authored
Remove unnecessary test (#22962)
1 parent e40f294 commit 57e28df

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/compiler/checker.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22501,19 +22501,17 @@ namespace ts {
2250122501
function checkForOfStatement(node: ForOfStatement): void {
2250222502
checkGrammarForInOrForOfStatement(node);
2250322503

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);
2251522509
}
2251622510
}
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+
}
2251722515

2251822516
// Check the LHS and RHS
2251922517
// If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS

0 commit comments

Comments
 (0)