Skip to content

Commit ffa1ea7

Browse files
Just always print out modifiers for global augmentations.
Apparently, they don't always need them!
1 parent d30c3dc commit ffa1ea7

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/compiler/emitter.ts

100644100755
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,17 +1862,8 @@ namespace ts {
18621862
}
18631863

18641864
function emitModuleDeclaration(node: ModuleDeclaration) {
1865-
if (node.flags & NodeFlags.GlobalAugmentation) {
1866-
if (!hasModifier(node, ModifierFlags.Ambient)) {
1867-
// Always emit a 'declare' keyword in case it wasn't provided by a factory function call.
1868-
write("declare ");
1869-
}
1870-
else {
1871-
emitModifiers(node, node.modifiers);
1872-
}
1873-
}
1874-
else {
1875-
emitModifiers(node, node.modifiers);
1865+
emitModifiers(node, node.modifiers);
1866+
if (~node.flags & NodeFlags.GlobalAugmentation) {
18761867
write(node.flags & NodeFlags.Namespace ? "namespace " : "module ");
18771868
}
18781869
emit(node.name);

0 commit comments

Comments
 (0)