File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -715,7 +715,7 @@ module ts {
715
715
} ;
716
716
}
717
717
}
718
-
718
+
719
719
function emitEnumDeclaration ( node : EnumDeclaration ) {
720
720
if ( resolver . isDeclarationVisible ( node ) ) {
721
721
emitJsDocComments ( node ) ;
@@ -3176,7 +3176,10 @@ module ts {
3176
3176
}
3177
3177
3178
3178
function emitModuleDeclaration ( node : ModuleDeclaration ) {
3179
- if ( getModuleInstanceState ( node ) !== ModuleInstanceState . Instantiated ) {
3179
+ var shouldEmit = getModuleInstanceState ( node ) === ModuleInstanceState . Instantiated ||
3180
+ ( getModuleInstanceState ( node ) === ModuleInstanceState . ConstEnumOnly && compilerOptions . preserveConstEnums ) ;
3181
+
3182
+ if ( ! shouldEmit ) {
3180
3183
return emitPinnedOrTripleSlashComments ( node ) ;
3181
3184
}
3182
3185
emitLeadingComments ( node ) ;
@@ -3558,7 +3561,7 @@ module ts {
3558
3561
return leadingComments ;
3559
3562
}
3560
3563
3561
-
3564
+
3562
3565
function getLeadingCommentsToEmit ( node : Node ) {
3563
3566
// Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments
3564
3567
if ( node . parent . kind === SyntaxKind . SourceFile || node . pos !== node . parent . pos ) {
You can’t perform that action at this time.
0 commit comments