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 {
1770
1770
1771
1771
function getExportsOfModule(moduleSymbol: Symbol): SymbolTable {
1772
1772
const links = getSymbolLinks(moduleSymbol);
1773
- return links.resolvedExports || (links.resolvedExports = getExportsForModule (moduleSymbol));
1773
+ return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker (moduleSymbol));
1774
1774
}
1775
1775
1776
1776
interface ExportCollisionTracker {
@@ -1807,13 +1807,13 @@ namespace ts {
1807
1807
});
1808
1808
}
1809
1809
1810
- function getExportsForModule (moduleSymbol: Symbol): SymbolTable {
1810
+ function getExportsOfModuleWorker (moduleSymbol: Symbol): SymbolTable {
1811
1811
const visitedSymbols: Symbol[] = [];
1812
1812
1813
1813
// A module defined by an 'export=' consists on one export that needs to be resolved
1814
1814
moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
1815
1815
1816
- return visit(moduleSymbol) || moduleSymbol.exports ;
1816
+ return visit(moduleSymbol) || emptySymbols ;
1817
1817
1818
1818
// The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,
1819
1819
// 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