diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts old mode 100644 new mode 100755 index f98533628d0..d458e7e5ef5 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -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);