emit publish of exported values in variable declarations

This commit is contained in:
Vladimir Matveev 2015-04-10 12:31:10 -07:00
parent 50496ccd97
commit 83fcca81a8

View File

@ -2740,7 +2740,6 @@ var __param = this.__param || function(index, decorator) { return function (targ
}
else {
renameNonTopLevelLetAndConst(<Identifier>node.name);
emitModuleMemberName(node);
let initializer = node.initializer;
if (!initializer && languageVersion < ScriptTarget.ES6) {
@ -2763,7 +2762,21 @@ var __param = this.__param || function(index, decorator) { return function (targ
}
}
let publishExportedValue =
currentFileIsEmittedAsSystemModule() && (getCombinedNodeFlags(node) & NodeFlags.Export) && isSourceFileLevelDeclaration(node);
if (publishExportedValue) {
write(`${exportFunctionForFile}("`);
emitNodeWithoutSourceMap(node.name);
write(`", `);
}
emitModuleMemberName(node);
emitOptional(" = ", initializer);
if (publishExportedValue) {
write(")")
}
}
}