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 {
8625
8625
localDeclarationSymbol !== symbol &&
8626
8626
localDeclarationSymbol.flags & SymbolFlags.BlockScopedVariable) {
8627
8627
if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & NodeFlags.BlockScoped) {
8628
-
8629
8628
let varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, SyntaxKind.VariableDeclarationList);
8630
8629
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;
8633
8633
8634
8634
// names of block-scoped and function scoped variables can collide only
8635
8635
// if block scoped variable is defined in the function\module\source file scope (because of variable hoisting)
8636
8636
let namesShareScope =
8637
8637
container &&
8638
8638
(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 ||
8640
8641
container.kind === SyntaxKind.SourceFile);
8641
8642
8642
8643
// 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