Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit ad9b601

Browse files
committed
describe what expandSymbolsFromExportStar does
Summary: Just add a comment. Reviewers: vikerman Reviewed By: vikerman Subscribers: typescript-eng Differential Revision: https://reviews.angular.io/D131
1 parent 46bb278 commit ad9b601

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/tsickle.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,13 @@ class Annotator extends Rewriter {
309309
return false;
310310
}
311311

312+
/**
313+
* Given a "export * from ..." statement, rewrites it to instead "export {foo, bar, baz} from
314+
* ...".
315+
* This is necessary because TS transpiles "export *" by just doing a runtime loop
316+
* over the target module's exports, which means Closure won't see the declarations/types
317+
* that are exported.
318+
*/
312319
private expandSymbolsFromExportStar(exportDecl: ts.ExportDeclaration): string[] {
313320
let typeChecker = this.program.getTypeChecker();
314321

@@ -330,7 +337,7 @@ class Annotator extends Rewriter {
330337
}
331338

332339
// Expand the export list, then filter it to the symbols we want
333-
// to reexport
340+
// to reexport.
334341
let exports =
335342
typeChecker.getExportsOfModule(typeChecker.getSymbolAtLocation(exportDecl.moduleSpecifier));
336343
let reexports: {[name: string]: boolean} = {};

0 commit comments

Comments
 (0)