mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixed crash in hasVisibleDeclarations related to binding elements (#61352)
This commit is contained in:
@@ -5981,7 +5981,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
|
||||
}
|
||||
else if (symbol.flags & SymbolFlags.BlockScopedVariable) {
|
||||
const variableStatement = findAncestor(declaration, isVariableStatement)!;
|
||||
const rootDeclaration = walkUpBindingElementsAndPatterns(declaration);
|
||||
if (rootDeclaration.kind === SyntaxKind.Parameter) {
|
||||
return false;
|
||||
}
|
||||
const variableStatement = rootDeclaration.parent.parent;
|
||||
if (variableStatement.kind !== SyntaxKind.VariableStatement) {
|
||||
return false;
|
||||
}
|
||||
if (hasSyntacticModifier(variableStatement, ModifierFlags.Export)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user