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)
|
||||
|
||||
Reference in New Issue
Block a user