mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Merge pull request #15516 from Microsoft/release-2.3_fix_importClause_npe
importTracker: Fix error for undefined importClause
This commit is contained in:
commit
eb123f9569
@ -212,6 +212,10 @@ namespace ts.FindAllReferences {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!decl.importClause) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { importClause } = decl;
|
||||
|
||||
const { namedBindings } = importClause;
|
||||
|
||||
11
tests/cases/fourslash/findAllRefsNoImportClause.ts
Normal file
11
tests/cases/fourslash/findAllRefsNoImportClause.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/issues/15452
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0;
|
||||
|
||||
// @Filename: /b.ts
|
||||
////import "./a";
|
||||
|
||||
verify.singleReferenceGroup("const x: 0");
|
||||
Loading…
x
Reference in New Issue
Block a user