mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 00:55:32 -05:00
Fix #14892: Add undefined check before using the intializer of for-statement
This commit is contained in:
@@ -1478,7 +1478,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
const initializer = node.initializer;
|
||||
if (isVariableDeclarationList(initializer)) {
|
||||
if (initializer && isVariableDeclarationList(initializer)) {
|
||||
for (const variable of initializer.declarations) {
|
||||
hoistVariableDeclaration(<Identifier>variable.name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user