mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
[Transforms] fix8155 : Hoist exported enum in system output (#8177)
* Hoist exported enum in system output * Update baselines
This commit is contained in:
@@ -675,6 +675,12 @@ namespace ts {
|
||||
const originalNode = getOriginalNode(node);
|
||||
if ((originalNode.kind === SyntaxKind.ModuleDeclaration || originalNode.kind === SyntaxKind.EnumDeclaration) && hasModifier(originalNode, ModifierFlags.Export)) {
|
||||
const name = getDeclarationName(<ModuleDeclaration | EnumDeclaration>originalNode);
|
||||
// We only need to hoistVariableDeclaration for EnumDeclaration
|
||||
// as ModuleDeclaration is already hoisted when the transformer call visitVariableStatement
|
||||
// which then call transformsVariable for each declaration in declarationList
|
||||
if (originalNode.kind === SyntaxKind.EnumDeclaration) {
|
||||
hoistVariableDeclaration(name);
|
||||
}
|
||||
return [
|
||||
node,
|
||||
createExportStatement(name, name)
|
||||
|
||||
@@ -14,7 +14,7 @@ System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function F() { }
|
||||
var F, C, C, E;
|
||||
var F, C, C, E, E;
|
||||
exports_1("F", F);
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
Reference in New Issue
Block a user