mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-02 02:25:17 -05:00
Fixed crash in hasVisibleDeclarations related to binding elements (#61352)
This commit is contained in:
committed by
GitHub
parent
c33f83ac9b
commit
2ea2ecfdc1
@@ -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