diff --git a/bin/tsc.js b/bin/tsc.js index 07f12e2b334..c1ce8cee83d 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -9104,7 +9104,8 @@ var ts; } } function emitModuleDeclaration(node) { - if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + var shouldEmit = ts.getModuleInstanceState(node) === 1 /* Instantiated */ || (ts.getModuleInstanceState(node) === 2 /* ConstEnumOnly */ && compilerOptions.preserveConstEnums); + if (!shouldEmit) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 3fdcc628581..8c36e0b88f6 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -8909,7 +8909,8 @@ var ts; } } function emitModuleDeclaration(node) { - if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + var shouldEmit = ts.getModuleInstanceState(node) === 1 /* Instantiated */ || (ts.getModuleInstanceState(node) === 2 /* ConstEnumOnly */ && compilerOptions.preserveConstEnums); + if (!shouldEmit) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node);