Skip to content

Commit 83fcca8

Browse files
committed
emit publish of exported values in variable declarations
1 parent 50496cc commit 83fcca8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: src/compiler/emitter.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -2740,7 +2740,6 @@ var __param = this.__param || function(index, decorator) { return function (targ
27402740
}
27412741
else {
27422742
renameNonTopLevelLetAndConst(<Identifier>node.name);
2743-
emitModuleMemberName(node);
27442743

27452744
let initializer = node.initializer;
27462745
if (!initializer && languageVersion < ScriptTarget.ES6) {
@@ -2763,7 +2762,21 @@ var __param = this.__param || function(index, decorator) { return function (targ
27632762
}
27642763
}
27652764

2765+
let publishExportedValue =
2766+
currentFileIsEmittedAsSystemModule() && (getCombinedNodeFlags(node) & NodeFlags.Export) && isSourceFileLevelDeclaration(node);
2767+
2768+
if (publishExportedValue) {
2769+
write(`${exportFunctionForFile}("`);
2770+
emitNodeWithoutSourceMap(node.name);
2771+
write(`", `);
2772+
}
2773+
2774+
emitModuleMemberName(node);
27662775
emitOptional(" = ", initializer);
2776+
2777+
if (publishExportedValue) {
2778+
write(")")
2779+
}
27672780
}
27682781
}
27692782

0 commit comments

Comments
 (0)