mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-16 15:51:35 -05:00
Only emit comment once for export enum declaration
This commit is contained in:
@@ -802,17 +802,17 @@ namespace ts {
|
||||
* Adds a trailing VariableStatement for an enum or module declaration.
|
||||
*/
|
||||
function addVarForExportedEnumOrNamespaceDeclaration(statements: Statement[], node: EnumDeclaration | ModuleDeclaration) {
|
||||
statements.push(
|
||||
createVariableStatement(
|
||||
/*modifiers*/ undefined,
|
||||
[createVariableDeclaration(
|
||||
getDeclarationName(node),
|
||||
const transformedStatement = createVariableStatement(
|
||||
/*modifiers*/ undefined,
|
||||
[createVariableDeclaration(
|
||||
getDeclarationName(node),
|
||||
/*type*/ undefined,
|
||||
createPropertyAccess(createIdentifier("exports"), getDeclarationName(node))
|
||||
)],
|
||||
createPropertyAccess(createIdentifier("exports"), getDeclarationName(node))
|
||||
)],
|
||||
/*location*/ node
|
||||
)
|
||||
);
|
||||
setNodeEmitFlags(transformedStatement, NodeEmitFlags.NoComments);
|
||||
statements.push(transformedStatement);
|
||||
}
|
||||
|
||||
function getDeclarationName(node: DeclarationStatement) {
|
||||
|
||||
Reference in New Issue
Block a user