mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #14343 from Microsoft/undefined_declarations
Add check for undefined declarations
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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("", []);
|
||||
Reference in New Issue
Block a user