File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -8625,18 +8625,19 @@ module ts {
86258625 localDeclarationSymbol !== symbol &&
86268626 localDeclarationSymbol.flags & SymbolFlags.BlockScopedVariable) {
86278627 if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & NodeFlags.BlockScoped) {
8628-
86298628 let varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, SyntaxKind.VariableDeclarationList);
86308629 let container =
8631- varDeclList.parent.kind === SyntaxKind.VariableStatement &&
8632- varDeclList.parent.parent;
8630+ varDeclList.parent.kind === SyntaxKind.VariableStatement && varDeclList.parent.parent
8631+ ? varDeclList.parent.parent
8632+ : undefined;
86338633
86348634 // names of block-scoped and function scoped variables can collide only
86358635 // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting)
86368636 let namesShareScope =
86378637 container &&
86388638 (container.kind === SyntaxKind.Block && isFunctionLike(container.parent) ||
8639- (container.kind === SyntaxKind.ModuleBlock && container.kind === SyntaxKind.ModuleDeclaration) ||
8639+ container.kind === SyntaxKind.ModuleBlock ||
8640+ container.kind === SyntaxKind.ModuleDeclaration ||
86408641 container.kind === SyntaxKind.SourceFile);
86418642
86428643 // here we know that function scoped variable is shadowed by block scoped one
You can’t perform that action at this time.
0 commit comments