Just always print out modifiers for global augmentations.

Apparently, they don't always need them!
This commit is contained in:
Daniel Rosenwasser 2017-09-22 00:12:37 -07:00
parent d30c3dcb4d
commit ffa1ea72c1

13
src/compiler/emitter.ts Normal file → Executable file
View File

@ -1862,17 +1862,8 @@ namespace ts {
}
function emitModuleDeclaration(node: ModuleDeclaration) {
if (node.flags & NodeFlags.GlobalAugmentation) {
if (!hasModifier(node, ModifierFlags.Ambient)) {
// Always emit a 'declare' keyword in case it wasn't provided by a factory function call.
write("declare ");
}
else {
emitModifiers(node, node.modifiers);
}
}
else {
emitModifiers(node, node.modifiers);
emitModifiers(node, node.modifiers);
if (~node.flags & NodeFlags.GlobalAugmentation) {
write(node.flags & NodeFlags.Namespace ? "namespace " : "module ");
}
emit(node.name);