File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1782,7 +1782,7 @@ namespace ts {
17821782
17831783 function getExportsOfModule(moduleSymbol: Symbol): SymbolTable {
17841784 const links = getSymbolLinks(moduleSymbol);
1785- return links.resolvedExports || (links.resolvedExports = getExportsForModule (moduleSymbol));
1785+ return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker (moduleSymbol));
17861786 }
17871787
17881788 interface ExportCollisionTracker {
@@ -1821,13 +1821,13 @@ namespace ts {
18211821 });
18221822 }
18231823
1824- function getExportsForModule (moduleSymbol: Symbol): SymbolTable {
1824+ function getExportsOfModuleWorker (moduleSymbol: Symbol): SymbolTable {
18251825 const visitedSymbols: Symbol[] = [];
18261826
18271827 // A module defined by an 'export=' consists on one export that needs to be resolved
18281828 moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
18291829
1830- return visit(moduleSymbol) || moduleSymbol.exports ;
1830+ return visit(moduleSymbol) || emptySymbols ;
18311831
18321832 // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
18331833 // 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