diff --git a/tests/baselines/reference/commentsModules.errors.txt b/tests/baselines/reference/commentsModules.errors.txt deleted file mode 100644 index 092a09b97cd..00000000000 --- a/tests/baselines/reference/commentsModules.errors.txt +++ /dev/null @@ -1,145 +0,0 @@ -commentsModules.ts(41,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(41,11): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(48,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(48,11): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(48,14): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(55,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(55,11): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(55,14): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(64,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(64,11): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(64,14): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(73,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(73,11): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(81,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. -commentsModules.ts(81,11): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - - -==== commentsModules.ts (15 errors) ==== - /** Module comment*/ - namespace m1 { - /** b's comment*/ - export var b: number; - /** foo's comment*/ - function foo() { - return b; - } - /** m2 comments*/ - export namespace m2 { - /** class comment;*/ - export class c { - }; - /** i*/ - export var i = new c(); - } - /** exported function*/ - export function fooExport() { - return foo(); - } - - // shouldn't appear - export function foo2Export(/**hm*/ a: string) { - } - - /** foo3Export - * comment - */ - export function foo3Export() { - } - - /** foo4Export - * comment - */ - function foo4Export() { - } - } // trailing comment module - m1.fooExport(); - var myvar = new m1.m2.c(); - /** module comment of m2.m3*/ - module m2.m3 { - ~~~~~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - /** Exported class comment*/ - export class c { - } - } /* trailing dotted module comment*/ - new m2.m3.c(); - /** module comment of m3.m4.m5*/ - module m3.m4.m5 { - ~~~~~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - /** Exported class comment*/ - export class c { - } - } // trailing dotted module 2 - new m3.m4.m5.c(); - /** module comment of m4.m5.m6*/ - module m4.m5.m6 { - ~~~~~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - export namespace m7 { - /** Exported class comment*/ - export class c { - } - } /* trailing inner module */ /* multiple comments*/ - } - new m4.m5.m6.m7.c(); - /** module comment of m5.m6.m7*/ - module m5.m6.m7 { - ~~~~~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - /** module m8 comment*/ - export namespace m8 { - /** Exported class comment*/ - export class c { - } - } - } - new m5.m6.m7.m8.c(); - module m6.m7 { - ~~~~~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - export namespace m8 { - /** Exported class comment*/ - export class c { - } - } - } - new m6.m7.m8.c(); - module m7.m8 { - ~~~~~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - ~~ -!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead. - /** module m9 comment*/ - export namespace m9 { - /** Exported class comment*/ - export class c { - } - - /** class d */ - class d { - } - - // class e - export class e { - } - } - } - new m7.m8.m9.c(); \ No newline at end of file diff --git a/tests/baselines/reference/commentsModules.js b/tests/baselines/reference/commentsModules.js index 7c307cfcb07..760d86d6c8c 100644 --- a/tests/baselines/reference/commentsModules.js +++ b/tests/baselines/reference/commentsModules.js @@ -41,21 +41,21 @@ namespace m1 { m1.fooExport(); var myvar = new m1.m2.c(); /** module comment of m2.m3*/ -module m2.m3 { +namespace m2.m3 { /** Exported class comment*/ export class c { } } /* trailing dotted module comment*/ new m2.m3.c(); /** module comment of m3.m4.m5*/ -module m3.m4.m5 { +namespace m3.m4.m5 { /** Exported class comment*/ export class c { } } // trailing dotted module 2 new m3.m4.m5.c(); /** module comment of m4.m5.m6*/ -module m4.m5.m6 { +namespace m4.m5.m6 { export namespace m7 { /** Exported class comment*/ export class c { @@ -64,7 +64,7 @@ module m4.m5.m6 { } new m4.m5.m6.m7.c(); /** module comment of m5.m6.m7*/ -module m5.m6.m7 { +namespace m5.m6.m7 { /** module m8 comment*/ export namespace m8 { /** Exported class comment*/ @@ -73,7 +73,7 @@ module m5.m6.m7 { } } new m5.m6.m7.m8.c(); -module m6.m7 { +namespace m6.m7 { export namespace m8 { /** Exported class comment*/ export class c { @@ -81,7 +81,7 @@ module m6.m7 { } } new m6.m7.m8.c(); -module m7.m8 { +namespace m7.m8 { /** module m9 comment*/ export namespace m9 { /** Exported class comment*/ diff --git a/tests/baselines/reference/commentsModules.symbols b/tests/baselines/reference/commentsModules.symbols index fe8083a1917..1fd0523c7a1 100644 --- a/tests/baselines/reference/commentsModules.symbols +++ b/tests/baselines/reference/commentsModules.symbols @@ -72,50 +72,50 @@ var myvar = new m1.m2.c(); >c : Symbol(m1.m2.c, Decl(commentsModules.ts, 9, 25)) /** module comment of m2.m3*/ -module m2.m3 { +namespace m2.m3 { >m2 : Symbol(m2, Decl(commentsModules.ts, 38, 26)) ->m3 : Symbol(m3, Decl(commentsModules.ts, 40, 10)) +>m3 : Symbol(m3, Decl(commentsModules.ts, 40, 13)) /** Exported class comment*/ export class c { ->c : Symbol(c, Decl(commentsModules.ts, 40, 14)) +>c : Symbol(c, Decl(commentsModules.ts, 40, 17)) } } /* trailing dotted module comment*/ new m2.m3.c(); ->m2.m3.c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 14)) ->m2.m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 10)) +>m2.m3.c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 17)) +>m2.m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 13)) >m2 : Symbol(m2, Decl(commentsModules.ts, 38, 26)) ->m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 10)) ->c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 14)) +>m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 13)) +>c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 17)) /** module comment of m3.m4.m5*/ -module m3.m4.m5 { +namespace m3.m4.m5 { >m3 : Symbol(m3, Decl(commentsModules.ts, 45, 14)) ->m4 : Symbol(m4, Decl(commentsModules.ts, 47, 10)) ->m5 : Symbol(m5, Decl(commentsModules.ts, 47, 13)) +>m4 : Symbol(m4, Decl(commentsModules.ts, 47, 13)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 47, 16)) /** Exported class comment*/ export class c { ->c : Symbol(c, Decl(commentsModules.ts, 47, 17)) +>c : Symbol(c, Decl(commentsModules.ts, 47, 20)) } } // trailing dotted module 2 new m3.m4.m5.c(); ->m3.m4.m5.c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 17)) ->m3.m4.m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 13)) ->m3.m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 10)) +>m3.m4.m5.c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 20)) +>m3.m4.m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 16)) +>m3.m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 13)) >m3 : Symbol(m3, Decl(commentsModules.ts, 45, 14)) ->m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 10)) ->m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 13)) ->c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 17)) +>m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 13)) +>m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 16)) +>c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 20)) /** module comment of m4.m5.m6*/ -module m4.m5.m6 { +namespace m4.m5.m6 { >m4 : Symbol(m4, Decl(commentsModules.ts, 52, 17)) ->m5 : Symbol(m5, Decl(commentsModules.ts, 54, 10)) ->m6 : Symbol(m6, Decl(commentsModules.ts, 54, 13)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 54, 13)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 54, 16)) export namespace m7 { ->m7 : Symbol(m7, Decl(commentsModules.ts, 54, 17)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 54, 20)) /** Exported class comment*/ export class c { @@ -125,24 +125,24 @@ module m4.m5.m6 { } new m4.m5.m6.m7.c(); >m4.m5.m6.m7.c : Symbol(m4.m5.m6.m7.c, Decl(commentsModules.ts, 55, 25)) ->m4.m5.m6.m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 17)) ->m4.m5.m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 13)) ->m4.m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 10)) +>m4.m5.m6.m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 20)) +>m4.m5.m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 16)) +>m4.m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 13)) >m4 : Symbol(m4, Decl(commentsModules.ts, 52, 17)) ->m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 10)) ->m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 13)) ->m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 17)) +>m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 13)) +>m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 16)) +>m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 20)) >c : Symbol(m4.m5.m6.m7.c, Decl(commentsModules.ts, 55, 25)) /** module comment of m5.m6.m7*/ -module m5.m6.m7 { +namespace m5.m6.m7 { >m5 : Symbol(m5, Decl(commentsModules.ts, 61, 20)) ->m6 : Symbol(m6, Decl(commentsModules.ts, 63, 10)) ->m7 : Symbol(m7, Decl(commentsModules.ts, 63, 13)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 63, 13)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 63, 16)) /** module m8 comment*/ export namespace m8 { ->m8 : Symbol(m8, Decl(commentsModules.ts, 63, 17)) +>m8 : Symbol(m8, Decl(commentsModules.ts, 63, 20)) /** Exported class comment*/ export class c { @@ -152,21 +152,21 @@ module m5.m6.m7 { } new m5.m6.m7.m8.c(); >m5.m6.m7.m8.c : Symbol(m5.m6.m7.m8.c, Decl(commentsModules.ts, 65, 25)) ->m5.m6.m7.m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 17)) ->m5.m6.m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 13)) ->m5.m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 10)) +>m5.m6.m7.m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 20)) +>m5.m6.m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 16)) +>m5.m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 13)) >m5 : Symbol(m5, Decl(commentsModules.ts, 61, 20)) ->m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 10)) ->m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 13)) ->m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 17)) +>m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 13)) +>m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 16)) +>m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 20)) >c : Symbol(m5.m6.m7.m8.c, Decl(commentsModules.ts, 65, 25)) -module m6.m7 { +namespace m6.m7 { >m6 : Symbol(m6, Decl(commentsModules.ts, 71, 20)) ->m7 : Symbol(m7, Decl(commentsModules.ts, 72, 10)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 72, 13)) export namespace m8 { ->m8 : Symbol(m8, Decl(commentsModules.ts, 72, 14)) +>m8 : Symbol(m8, Decl(commentsModules.ts, 72, 17)) /** Exported class comment*/ export class c { @@ -176,20 +176,20 @@ module m6.m7 { } new m6.m7.m8.c(); >m6.m7.m8.c : Symbol(m6.m7.m8.c, Decl(commentsModules.ts, 73, 25)) ->m6.m7.m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 14)) ->m6.m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 10)) +>m6.m7.m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 17)) +>m6.m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 13)) >m6 : Symbol(m6, Decl(commentsModules.ts, 71, 20)) ->m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 10)) ->m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 14)) +>m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 13)) +>m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 17)) >c : Symbol(m6.m7.m8.c, Decl(commentsModules.ts, 73, 25)) -module m7.m8 { +namespace m7.m8 { >m7 : Symbol(m7, Decl(commentsModules.ts, 79, 17)) ->m8 : Symbol(m8, Decl(commentsModules.ts, 80, 10)) +>m8 : Symbol(m8, Decl(commentsModules.ts, 80, 13)) /** module m9 comment*/ export namespace m9 { ->m9 : Symbol(m9, Decl(commentsModules.ts, 80, 14)) +>m9 : Symbol(m9, Decl(commentsModules.ts, 80, 17)) /** Exported class comment*/ export class c { @@ -209,10 +209,10 @@ module m7.m8 { } new m7.m8.m9.c(); >m7.m8.m9.c : Symbol(m7.m8.m9.c, Decl(commentsModules.ts, 82, 25)) ->m7.m8.m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 14)) ->m7.m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 10)) +>m7.m8.m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 17)) +>m7.m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 13)) >m7 : Symbol(m7, Decl(commentsModules.ts, 79, 17)) ->m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 10)) ->m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 14)) +>m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 13)) +>m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 17)) >c : Symbol(m7.m8.m9.c, Decl(commentsModules.ts, 82, 25)) diff --git a/tests/baselines/reference/commentsModules.types b/tests/baselines/reference/commentsModules.types index 1ca13f0c2b5..9d220875c78 100644 --- a/tests/baselines/reference/commentsModules.types +++ b/tests/baselines/reference/commentsModules.types @@ -103,7 +103,7 @@ var myvar = new m1.m2.c(); > : ^^^^^^^^^^^^^^ /** module comment of m2.m3*/ -module m2.m3 { +namespace m2.m3 { >m2 : typeof m2 > : ^^^^^^^^^ >m3 : typeof m3 @@ -130,7 +130,7 @@ new m2.m3.c(); > : ^^^^^^^^^^^^^^ /** module comment of m3.m4.m5*/ -module m3.m4.m5 { +namespace m3.m4.m5 { >m3 : typeof m3 > : ^^^^^^^^^ >m4 : typeof m4 @@ -163,7 +163,7 @@ new m3.m4.m5.c(); > : ^^^^^^^^^^^^^^^^^ /** module comment of m4.m5.m6*/ -module m4.m5.m6 { +namespace m4.m5.m6 { >m4 : typeof m4 > : ^^^^^^^^^ >m5 : typeof m5 @@ -205,7 +205,7 @@ new m4.m5.m6.m7.c(); > : ^^^^^^^^^^^^^^^^^^^^ /** module comment of m5.m6.m7*/ -module m5.m6.m7 { +namespace m5.m6.m7 { >m5 : typeof m5 > : ^^^^^^^^^ >m6 : typeof m6 @@ -247,7 +247,7 @@ new m5.m6.m7.m8.c(); >c : typeof m5.m6.m7.m8.c > : ^^^^^^^^^^^^^^^^^^^^ -module m6.m7 { +namespace m6.m7 { >m6 : typeof m6 > : ^^^^^^^^^ >m7 : typeof m7 @@ -282,7 +282,7 @@ new m6.m7.m8.c(); >c : typeof m6.m7.m8.c > : ^^^^^^^^^^^^^^^^^ -module m7.m8 { +namespace m7.m8 { >m7 : typeof m7 > : ^^^^^^^^^ >m8 : typeof m8 diff --git a/tests/cases/compiler/commentsModules.ts b/tests/cases/compiler/commentsModules.ts index de0bea7b635..e0111263463 100644 --- a/tests/cases/compiler/commentsModules.ts +++ b/tests/cases/compiler/commentsModules.ts @@ -1,100 +1,100 @@ -// @target: ES5 -// @declaration: true -// @removeComments: false -/** Module comment*/ -namespace m1 { - /** b's comment*/ - export var b: number; - /** foo's comment*/ - function foo() { - return b; - } - /** m2 comments*/ - export namespace m2 { - /** class comment;*/ - export class c { - }; - /** i*/ - export var i = new c(); - } - /** exported function*/ - export function fooExport() { - return foo(); - } - - // shouldn't appear - export function foo2Export(/**hm*/ a: string) { - } - - /** foo3Export - * comment - */ - export function foo3Export() { - } - - /** foo4Export - * comment - */ - function foo4Export() { - } -} // trailing comment module -m1.fooExport(); -var myvar = new m1.m2.c(); -/** module comment of m2.m3*/ -module m2.m3 { - /** Exported class comment*/ - export class c { - } -} /* trailing dotted module comment*/ -new m2.m3.c(); -/** module comment of m3.m4.m5*/ -module m3.m4.m5 { - /** Exported class comment*/ - export class c { - } -} // trailing dotted module 2 -new m3.m4.m5.c(); -/** module comment of m4.m5.m6*/ -module m4.m5.m6 { - export namespace m7 { - /** Exported class comment*/ - export class c { - } - } /* trailing inner module */ /* multiple comments*/ -} -new m4.m5.m6.m7.c(); -/** module comment of m5.m6.m7*/ -module m5.m6.m7 { - /** module m8 comment*/ - export namespace m8 { - /** Exported class comment*/ - export class c { - } - } -} -new m5.m6.m7.m8.c(); -module m6.m7 { - export namespace m8 { - /** Exported class comment*/ - export class c { - } - } -} -new m6.m7.m8.c(); -module m7.m8 { - /** module m9 comment*/ - export namespace m9 { - /** Exported class comment*/ - export class c { - } - - /** class d */ - class d { - } - - // class e - export class e { - } - } -} +// @target: ES5 +// @declaration: true +// @removeComments: false +/** Module comment*/ +namespace m1 { + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export namespace m2 { + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } + + // shouldn't appear + export function foo2Export(/**hm*/ a: string) { + } + + /** foo3Export + * comment + */ + export function foo3Export() { + } + + /** foo4Export + * comment + */ + function foo4Export() { + } +} // trailing comment module +m1.fooExport(); +var myvar = new m1.m2.c(); +/** module comment of m2.m3*/ +namespace m2.m3 { + /** Exported class comment*/ + export class c { + } +} /* trailing dotted module comment*/ +new m2.m3.c(); +/** module comment of m3.m4.m5*/ +namespace m3.m4.m5 { + /** Exported class comment*/ + export class c { + } +} // trailing dotted module 2 +new m3.m4.m5.c(); +/** module comment of m4.m5.m6*/ +namespace m4.m5.m6 { + export namespace m7 { + /** Exported class comment*/ + export class c { + } + } /* trailing inner module */ /* multiple comments*/ +} +new m4.m5.m6.m7.c(); +/** module comment of m5.m6.m7*/ +namespace m5.m6.m7 { + /** module m8 comment*/ + export namespace m8 { + /** Exported class comment*/ + export class c { + } + } +} +new m5.m6.m7.m8.c(); +namespace m6.m7 { + export namespace m8 { + /** Exported class comment*/ + export class c { + } + } +} +new m6.m7.m8.c(); +namespace m7.m8 { + /** module m9 comment*/ + export namespace m9 { + /** Exported class comment*/ + export class c { + } + + /** class d */ + class d { + } + + // class e + export class e { + } + } +} new m7.m8.m9.c(); \ No newline at end of file diff --git a/tests/cases/compiler/declFileModuleContinuation.ts b/tests/cases/compiler/declFileModuleContinuation.ts index 7cacfc51682..8f343960ea2 100644 --- a/tests/cases/compiler/declFileModuleContinuation.ts +++ b/tests/cases/compiler/declFileModuleContinuation.ts @@ -1,10 +1,10 @@ -// @declaration: true -module A.C { - export interface Z { - } -} - -module A.B.C { - export class W implements A.C.Z { - } +// @declaration: true +namespace A.C { + export interface Z { + } +} + +namespace A.B.C { + export class W implements A.C.Z { + } } \ No newline at end of file diff --git a/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause1.ts b/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause1.ts index 5df817bd06a..c0dcd6fc1eb 100644 --- a/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause1.ts +++ b/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause1.ts @@ -1,12 +1,12 @@ // @declaration: true -module X.A.C { - export interface Z { - } +namespace X.A.C { + export interface Z { + } } -module X.A.B.C { - namespace A { - } - export class W implements X.A.C.Z { // This needs to be referred as X.A.C.Z as A has conflict - } +namespace X.A.B.C { + namespace A { + } + export class W implements X.A.C.Z { // This needs to be referred as X.A.C.Z as A has conflict + } } \ No newline at end of file diff --git a/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts b/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts index 2421451e4e6..3699300751e 100644 --- a/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts +++ b/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts @@ -1,15 +1,15 @@ // @declaration: true -module X.A.C { - export interface Z { - } -} -module X.A.B.C { - export class W implements A.C.Z { // This can refer to it as A.C.Z - } -} - -module X.A.B.C { - namespace A { - } +namespace X.A.C { + export interface Z { + } +} +namespace X.A.B.C { + export class W implements A.C.Z { // This can refer to it as A.C.Z + } +} + +namespace X.A.B.C { + namespace A { + } } \ No newline at end of file diff --git a/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause3.ts b/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause3.ts index 1fbc328712d..7487e4a6a2a 100644 --- a/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause3.ts +++ b/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause3.ts @@ -1,15 +1,15 @@ // @declaration: true -module X.A.C { - export interface Z { - } -} -module X.A.B.C { - export class W implements X.A.C.Z { // This needs to be referred as X.A.C.Z as A has conflict - } -} - -module X.A.B.C { - export namespace A { - } +namespace X.A.C { + export interface Z { + } +} +namespace X.A.B.C { + export class W implements X.A.C.Z { // This needs to be referred as X.A.C.Z as A has conflict + } +} + +namespace X.A.B.C { + export namespace A { + } } \ No newline at end of file diff --git a/tests/cases/compiler/declareDottedModuleName.ts b/tests/cases/compiler/declareDottedModuleName.ts index ed8bab25a7a..6126ad82595 100644 --- a/tests/cases/compiler/declareDottedModuleName.ts +++ b/tests/cases/compiler/declareDottedModuleName.ts @@ -1,11 +1,11 @@ -// @declaration: true -namespace M { - module P.Q { } // This shouldnt be emitted -} - -namespace M { - export module R.S { } //This should be emitted -} - -module T.U { // This needs to be emitted +// @declaration: true +namespace M { + namespace P.Q { } // This shouldnt be emitted +} + +namespace M { + export namespace R.S { } //This should be emitted +} + +namespace T.U { // This needs to be emitted } \ No newline at end of file diff --git a/tests/cases/compiler/dottedModuleName.ts b/tests/cases/compiler/dottedModuleName.ts index effc138860c..d2087dba603 100644 --- a/tests/cases/compiler/dottedModuleName.ts +++ b/tests/cases/compiler/dottedModuleName.ts @@ -1,18 +1,18 @@ -namespace M { - export namespace N { - export function f(x:number)=>2*x; - export module X.Y.Z { - export var v2=f(v); - } - } -} - - - -module M.N { - export namespace X { - export module Y.Z { - export var v=f(10); - } - } -} +namespace M { + export namespace N { + export function f(x:number)=>2*x; + export module X.Y.Z { + export var v2=f(v); + } + } +} + + + +namespace M.N { + export namespace X { + export namespace Y.Z { + export var v=f(10); + } + } +} diff --git a/tests/cases/compiler/dottedModuleName2.ts b/tests/cases/compiler/dottedModuleName2.ts index 376d17e55a5..792d62979c0 100644 --- a/tests/cases/compiler/dottedModuleName2.ts +++ b/tests/cases/compiler/dottedModuleName2.ts @@ -1,4 +1,4 @@ -module A.B { +namespace A.B { export var x = 1; @@ -19,7 +19,7 @@ var tmpOK = AA.B.x; var tmpError = A.B.x; -module A.B.C +namespace A.B.C { diff --git a/tests/cases/compiler/escapedIdentifiers.ts b/tests/cases/compiler/escapedIdentifiers.ts index c220bd19320..b253a00cc21 100644 --- a/tests/cases/compiler/escapedIdentifiers.ts +++ b/tests/cases/compiler/escapedIdentifiers.ts @@ -25,8 +25,8 @@ b ++; namespace moduleType1 { export var baz1: number; } -module moduleType\u0032 { - export var baz2: number; +namespace moduleType\u0032 { + export var baz2: number; } moduleType1.baz1 = 3; diff --git a/tests/cases/compiler/functionMergedWithModule.ts b/tests/cases/compiler/functionMergedWithModule.ts index 8d4294f99b5..f47937b2aba 100644 --- a/tests/cases/compiler/functionMergedWithModule.ts +++ b/tests/cases/compiler/functionMergedWithModule.ts @@ -1,14 +1,14 @@ -function foo(title: string) { - var x = 10; -} - -module foo.Bar { - export function f() { - } -} - -module foo.Baz { - export function g() { - Bar.f(); - } +function foo(title: string) { + var x = 10; +} + +namespace foo.Bar { + export function f() { + } +} + +namespace foo.Baz { + export function g() { + Bar.f(); + } } \ No newline at end of file diff --git a/tests/cases/compiler/mergedModuleDeclarationCodeGen2.ts b/tests/cases/compiler/mergedModuleDeclarationCodeGen2.ts index 82051c76abc..6ece3a49645 100644 --- a/tests/cases/compiler/mergedModuleDeclarationCodeGen2.ts +++ b/tests/cases/compiler/mergedModuleDeclarationCodeGen2.ts @@ -1,7 +1,7 @@ -module my.data.foo { +namespace my.data.foo { export function buz() { } } -module my.data { +namespace my.data { function data(my) { foo.buz(); } diff --git a/tests/cases/compiler/mergedModuleDeclarationCodeGen3.ts b/tests/cases/compiler/mergedModuleDeclarationCodeGen3.ts index 0430bf27c7c..9b11e62d289 100644 --- a/tests/cases/compiler/mergedModuleDeclarationCodeGen3.ts +++ b/tests/cases/compiler/mergedModuleDeclarationCodeGen3.ts @@ -1,7 +1,7 @@ -module my.data { +namespace my.data { export function buz() { } } -module my.data.foo { +namespace my.data.foo { function data(my, foo) { buz(); } diff --git a/tests/cases/compiler/mergedModuleDeclarationCodeGen5.ts b/tests/cases/compiler/mergedModuleDeclarationCodeGen5.ts index 344b693b7ca..894ef732a60 100644 --- a/tests/cases/compiler/mergedModuleDeclarationCodeGen5.ts +++ b/tests/cases/compiler/mergedModuleDeclarationCodeGen5.ts @@ -1,8 +1,8 @@ -module M.buz.plop { +namespace M.buz.plop { export function doom() { } export function M() { } } -module M.buz.plop { +namespace M.buz.plop { function gunk() { } function buz() { } export class fudge { } diff --git a/tests/cases/compiler/strictModeReservedWordInModuleDeclaration.ts b/tests/cases/compiler/strictModeReservedWordInModuleDeclaration.ts index 55245970e65..3f98e6fedf5 100644 --- a/tests/cases/compiler/strictModeReservedWordInModuleDeclaration.ts +++ b/tests/cases/compiler/strictModeReservedWordInModuleDeclaration.ts @@ -1,6 +1,6 @@ -"use strict" -namespace public { } -namespace private { } -module public.whatever { -} -module private.public.foo { } \ No newline at end of file +"use strict" +namespace public { } +namespace private { } +namespace public.whatever { +} +namespace private.public.foo { } \ No newline at end of file