Merge pull request #14343 from Microsoft/undefined_declarations
Add check for undefined declarations
This commit is contained in:
commit
fc9bcc1d8f
2 changed files with 15 additions and 1 deletions
|
@ -198,7 +198,11 @@ namespace ts.GoToDefinition {
|
|||
return false;
|
||||
}
|
||||
|
||||
function tryAddSignature(signatureDeclarations: Declaration[], selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) {
|
||||
function tryAddSignature(signatureDeclarations: Declaration[] | undefined, selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) {
|
||||
if (!signatureDeclarations) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const declarations: Declaration[] = [];
|
||||
let definition: Declaration | undefined;
|
||||
|
||||
|
|
10
tests/cases/fourslash/goToDefinition_untypedModule.ts
Normal file
10
tests/cases/fourslash/goToDefinition_untypedModule.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: /node_modules/foo/index.js
|
||||
////not read
|
||||
|
||||
// @Filename: /a.ts
|
||||
////import { f } from "foo";
|
||||
/////**/f();
|
||||
|
||||
verify.goToDefinition("", []);
|
Loading…
Reference in a new issue