Skip to content

Commit 8c44c88

Browse files
author
Joey Watts
committed
Fix checker crash with new block scoped bindings
Signed-off-by: Joey Watts <jwatts43@bloomberg.net>
1 parent c24df57 commit 8c44c88

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17721,6 +17721,7 @@ namespace ts {
1772117721
// mark variables that are declared in loop initializer and reassigned inside the body of ForStatement.
1772217722
// if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back.
1772317723
if (container.kind === SyntaxKind.ForStatement &&
17724+
symbol.valueDeclaration.kind === SyntaxKind.VariableDeclaration &&
1772417725
getAncestor(symbol.valueDeclaration, SyntaxKind.VariableDeclarationList)!.parent === container &&
1772517726
isAssignedInBodyOfForStatement(node, <ForStatement>container)) {
1772617727
getNodeLinks(symbol.valueDeclaration).flags |= NodeCheckFlags.NeedsLoopOutParameter;

0 commit comments

Comments
 (0)