Use safe some function to handle undefined declarations (fixes #27338)
This commit is contained in:
parent
d2647a1dda
commit
d0abd399af
1 changed files with 1 additions and 1 deletions
|
@ -1397,7 +1397,7 @@ namespace ts.Completions {
|
||||||
if (resolvedModuleSymbol !== moduleSymbol &&
|
if (resolvedModuleSymbol !== moduleSymbol &&
|
||||||
// Don't add another completion for `export =` of a symbol that's already global.
|
// Don't add another completion for `export =` of a symbol that's already global.
|
||||||
// So in `declare namespace foo {} declare module "foo" { export = foo; }`, there will just be the global completion for `foo`.
|
// So in `declare namespace foo {} declare module "foo" { export = foo; }`, there will just be the global completion for `foo`.
|
||||||
resolvedModuleSymbol.declarations.some(d => !!d.getSourceFile().externalModuleIndicator)) {
|
some(resolvedModuleSymbol.declarations, d => !!d.getSourceFile().externalModuleIndicator)) {
|
||||||
symbols.push(resolvedModuleSymbol);
|
symbols.push(resolvedModuleSymbol);
|
||||||
symbolToOriginInfoMap[getSymbolId(resolvedModuleSymbol)] = { kind: SymbolOriginInfoKind.Export, moduleSymbol, isDefaultExport: false };
|
symbolToOriginInfoMap[getSymbolId(resolvedModuleSymbol)] = { kind: SymbolOriginInfoKind.Export, moduleSymbol, isDefaultExport: false };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue