mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
Never elide an export * when --isolatedModules is set
This commit is contained in:
@@ -2922,7 +2922,7 @@ namespace ts {
|
||||
function visitExportDeclaration(node: ExportDeclaration): VisitResult<Statement> {
|
||||
if (!node.exportClause) {
|
||||
// Elide a star export if the module it references does not export a value.
|
||||
return resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
|
||||
return compilerOptions.isolatedModules || resolver.moduleExportsSomeValue(node.moduleSpecifier) ? node : undefined;
|
||||
}
|
||||
|
||||
if (!resolver.isValueAliasDeclaration(node)) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [tests/cases/compiler/isolatedModulesDontElideReExportStar.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
export type T = number;
|
||||
|
||||
//// [b.ts]
|
||||
export * from "./a";
|
||||
|
||||
|
||||
//// [a.js]
|
||||
//// [b.js]
|
||||
export * from "./a";
|
||||
@@ -0,0 +1,8 @@
|
||||
=== /a.ts ===
|
||||
export type T = number;
|
||||
>T : Symbol(T, Decl(a.ts, 0, 0))
|
||||
|
||||
=== /b.ts ===
|
||||
export * from "./a";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,8 @@
|
||||
=== /a.ts ===
|
||||
export type T = number;
|
||||
>T : number
|
||||
|
||||
=== /b.ts ===
|
||||
export * from "./a";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,8 @@
|
||||
// @isolatedModules: true
|
||||
// @target: es6
|
||||
|
||||
// @filename: /a.ts
|
||||
export type T = number;
|
||||
|
||||
// @filename: /b.ts
|
||||
export * from "./a";
|
||||
Reference in New Issue
Block a user