File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1770,7 +1770,7 @@ namespace ts {
17701770
17711771 function getExportsOfModule(moduleSymbol: Symbol): SymbolTable {
17721772 const links = getSymbolLinks(moduleSymbol);
1773- return links.resolvedExports || (links.resolvedExports = getExportsForModule (moduleSymbol));
1773+ return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker (moduleSymbol));
17741774 }
17751775
17761776 interface ExportCollisionTracker {
@@ -1807,13 +1807,13 @@ namespace ts {
18071807 });
18081808 }
18091809
1810- function getExportsForModule (moduleSymbol: Symbol): SymbolTable {
1810+ function getExportsOfModuleWorker (moduleSymbol: Symbol): SymbolTable {
18111811 const visitedSymbols: Symbol[] = [];
18121812
18131813 // A module defined by an 'export=' consists on one export that needs to be resolved
18141814 moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
18151815
1816- return visit(moduleSymbol) || moduleSymbol.exports ;
1816+ return visit(moduleSymbol) || emptySymbols ;
18171817
18181818 // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
18191819 // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error.
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts'/>
2+
3+ // This used to cause a crash because we would ask for exports on `"x"`,
4+ // which would return undefined and cause a NPE. Now we return emptySymbol instead.
5+ // See GH#16610.
6+
7+ ////declare module "x" {
8+ //// declare var x: number;
9+ //// export = x;
10+ //// }
11+ ////
12+ ////let y: /**/
13+
14+ goTo . marker ( ) ;
15+ // This is just a dummy test to cause `getCompletionsAtPosition` to be called.
16+ verify . not . completionListContains ( "x" ) ;
You can’t perform that action at this time.
0 commit comments