mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 19:27:35 -06:00
fix ES6 emit for namespaces to only emit one export binding
This commit is contained in:
parent
d0fc3948b5
commit
6a8e78cdc0
@ -6318,15 +6318,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
const emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node);
|
||||
|
||||
if (emitVarForModule) {
|
||||
emitStart(node);
|
||||
if (isES6ExportedDeclaration(node)) {
|
||||
write("export ");
|
||||
const isES6ExportedNamespace = isES6ExportedDeclaration(node);
|
||||
if ((!isES6ExportedNamespace) || !forEach(node.symbol && node.symbol.declarations, declaration => declaration.kind === SyntaxKind.ModuleDeclaration && declaration.pos < node.pos)) {
|
||||
emitStart(node);
|
||||
if (isES6ExportedNamespace) {
|
||||
write("export ");
|
||||
}
|
||||
write("var ");
|
||||
emit(node.name);
|
||||
write(";");
|
||||
emitEnd(node);
|
||||
writeLine();
|
||||
}
|
||||
write("var ");
|
||||
emit(node.name);
|
||||
write(";");
|
||||
emitEnd(node);
|
||||
writeLine();
|
||||
}
|
||||
|
||||
emitStart(node);
|
||||
|
||||
@ -58,7 +58,6 @@ export var M;
|
||||
// alias
|
||||
M.M_A = M_M;
|
||||
})(M || (M = {}));
|
||||
export var M;
|
||||
(function (M) {
|
||||
// Reexports
|
||||
export { M_V as v };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user