mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
enclosingDeclaration can be undefined within getAccessibleSymbolChain (#18400)
This commit is contained in:
parent
2fbc2259a1
commit
403f585622
@ -2063,7 +2063,7 @@ namespace ts {
|
||||
return rightMeaning === SymbolFlags.Value ? SymbolFlags.Value : SymbolFlags.Namespace;
|
||||
}
|
||||
|
||||
function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] | undefined {
|
||||
function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] | undefined {
|
||||
if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) {
|
||||
return undefined;
|
||||
}
|
||||
@ -2112,7 +2112,7 @@ namespace ts {
|
||||
if (symbolFromSymbolTable.flags & SymbolFlags.Alias
|
||||
&& symbolFromSymbolTable.escapedName !== "export="
|
||||
&& !getDeclarationOfKind(symbolFromSymbolTable, SyntaxKind.ExportSpecifier)
|
||||
&& !(isUMDExportSymbol(symbolFromSymbolTable) && isExternalModule(getSourceFileOfNode(enclosingDeclaration)))
|
||||
&& !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration)))
|
||||
// If `!useOnlyExternalAliasing`, we can use any type of alias to get the name
|
||||
&& (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration))) {
|
||||
|
||||
@ -2132,7 +2132,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function needsQualification(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags) {
|
||||
function needsQualification(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags) {
|
||||
let qualify = false;
|
||||
forEachSymbolTableInScope(enclosingDeclaration, symbolTable => {
|
||||
// If symbol of this name is not available in the symbol table we are ok
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user