diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js new file mode 100644 index 0000000000..81f627ebed --- /dev/null +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/sourceMapWithMultipleFilesWithFileEndingWithInterface.ts] //// + +//// [a.ts] +module M { + export var X = 1; +} +interface Navigator { + getGamepads(func?: any): any; + webkitGetGamepads(func?: any): any + msGetGamepads(func?: any): any; + webkitGamepads(func?: any): any; +} + +//// [b.ts] +module m1 { + export class c1 { + } +} + +//// [fooResult.js] +var M; +(function (M) { + M.X = 1; +})(M || (M = {})); +var m1; +(function (m1) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m1.c1 = c1; +})(m1 || (m1 = {})); +//# sourceMappingURL=fooResult.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js.map b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js.map new file mode 100644 index 0000000000..1142b4313a --- /dev/null +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.js.map @@ -0,0 +1,2 @@ +//// [fooResult.js.map] +{"version":3,"file":"fooResult.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":["M","m1","m1.c1","m1.c1.constructor"],"mappings":"AAAA,IAAO,CAAC,CAEP;AAFD,WAAO,CAAC,EAAC,CAAC;IACKA,GAACA,GAAGA,CAACA,CAACA;AACrBA,CAACA,EAFM,CAAC,KAAD,CAAC,QAEP;ACFD,IAAO,EAAE,CAGR;AAHD,WAAO,EAAE,EAAC,CAAC;IACPC,IAAaA,EAAEA;QAAfC,SAAaA,EAAEA;QACfC,CAACA;QAADD,SAACA;IAADA,CAACA,AADDD,IACCA;IADYA,KAAEA,GAAFA,EACZA,CAAAA;AACLA,CAACA,EAHM,EAAE,KAAF,EAAE,QAGR"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt new file mode 100644 index 0000000000..e58ed879c6 --- /dev/null +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.sourcemap.txt @@ -0,0 +1,235 @@ +=================================================================== +JsFile: fooResult.js +mapUrl: fooResult.js.map +sourceRoot: +sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:fooResult.js +sourceFile:tests/cases/compiler/a.ts +------------------------------------------------------------------- +>>>var M; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > +2 >module +3 > M +4 > { + > export var X = 1; + > } +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 9) + SourceIndex(0) +4 >Emitted(1, 7) Source(3, 2) + SourceIndex(0) +--- +>>>(function (M) { +1-> +2 >^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1-> +2 >module +3 > M +4 > +5 > { +1->Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(1, 8) + SourceIndex(0) +3 >Emitted(2, 13) Source(1, 9) + SourceIndex(0) +4 >Emitted(2, 15) Source(1, 10) + SourceIndex(0) +5 >Emitted(2, 16) Source(1, 11) + SourceIndex(0) +--- +>>> M.X = 1; +1 >^^^^ +2 > ^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^-> +1 > + > export var +2 > X +3 > = +4 > 1 +5 > ; +1 >Emitted(3, 5) Source(2, 16) + SourceIndex(0) name (M) +2 >Emitted(3, 8) Source(2, 17) + SourceIndex(0) name (M) +3 >Emitted(3, 11) Source(2, 20) + SourceIndex(0) name (M) +4 >Emitted(3, 12) Source(2, 21) + SourceIndex(0) name (M) +5 >Emitted(3, 13) Source(2, 22) + SourceIndex(0) name (M) +--- +>>>})(M || (M = {})); +1-> +2 >^ +3 > ^^ +4 > ^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > M +5 > +6 > M +7 > { + > export var X = 1; + > } +1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) name (M) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) name (M) +3 >Emitted(4, 4) Source(1, 8) + SourceIndex(0) +4 >Emitted(4, 5) Source(1, 9) + SourceIndex(0) +5 >Emitted(4, 10) Source(1, 8) + SourceIndex(0) +6 >Emitted(4, 11) Source(1, 9) + SourceIndex(0) +7 >Emitted(4, 19) Source(3, 2) + SourceIndex(0) +--- +------------------------------------------------------------------- +emittedFile:fooResult.js +sourceFile:tests/cases/compiler/b.ts +------------------------------------------------------------------- +>>>var m1; +1 > +2 >^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > +2 >module +3 > m1 +4 > { + > export class c1 { + > } + > } +1 >Emitted(5, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(5, 5) Source(1, 8) + SourceIndex(1) +3 >Emitted(5, 7) Source(1, 10) + SourceIndex(1) +4 >Emitted(5, 8) Source(4, 2) + SourceIndex(1) +--- +>>>(function (m1) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> +1-> +2 >module +3 > m1 +4 > +5 > { +1->Emitted(6, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(6, 12) Source(1, 8) + SourceIndex(1) +3 >Emitted(6, 14) Source(1, 10) + SourceIndex(1) +4 >Emitted(6, 16) Source(1, 11) + SourceIndex(1) +5 >Emitted(6, 17) Source(1, 12) + SourceIndex(1) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(7, 5) Source(2, 5) + SourceIndex(1) name (m1) +2 >Emitted(7, 9) Source(2, 18) + SourceIndex(1) name (m1) +3 >Emitted(7, 11) Source(2, 20) + SourceIndex(1) name (m1) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(8, 9) Source(2, 5) + SourceIndex(1) name (m1.c1) +2 >Emitted(8, 18) Source(2, 18) + SourceIndex(1) name (m1.c1) +3 >Emitted(8, 20) Source(2, 20) + SourceIndex(1) name (m1.c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > +2 > } +1 >Emitted(9, 9) Source(3, 5) + SourceIndex(1) name (m1.c1.constructor) +2 >Emitted(9, 10) Source(3, 6) + SourceIndex(1) name (m1.c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(10, 9) Source(3, 5) + SourceIndex(1) name (m1.c1) +2 >Emitted(10, 18) Source(3, 6) + SourceIndex(1) name (m1.c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > } +1 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) name (m1.c1) +2 >Emitted(11, 6) Source(3, 6) + SourceIndex(1) name (m1.c1) +3 >Emitted(11, 6) Source(2, 5) + SourceIndex(1) name (m1) +4 >Emitted(11, 10) Source(3, 6) + SourceIndex(1) name (m1) +--- +>>> m1.c1 = c1; +1->^^^^ +2 > ^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > } +5 > +1->Emitted(12, 5) Source(2, 18) + SourceIndex(1) name (m1) +2 >Emitted(12, 10) Source(2, 20) + SourceIndex(1) name (m1) +3 >Emitted(12, 13) Source(2, 18) + SourceIndex(1) name (m1) +4 >Emitted(12, 15) Source(3, 6) + SourceIndex(1) name (m1) +5 >Emitted(12, 16) Source(3, 6) + SourceIndex(1) name (m1) +--- +>>>})(m1 || (m1 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >} +3 > +4 > m1 +5 > +6 > m1 +7 > { + > export class c1 { + > } + > } +1->Emitted(13, 1) Source(4, 1) + SourceIndex(1) name (m1) +2 >Emitted(13, 2) Source(4, 2) + SourceIndex(1) name (m1) +3 >Emitted(13, 4) Source(1, 8) + SourceIndex(1) +4 >Emitted(13, 6) Source(1, 10) + SourceIndex(1) +5 >Emitted(13, 11) Source(1, 8) + SourceIndex(1) +6 >Emitted(13, 13) Source(1, 10) + SourceIndex(1) +7 >Emitted(13, 21) Source(4, 2) + SourceIndex(1) +--- +>>>//# sourceMappingURL=fooResult.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types new file mode 100644 index 0000000000..6e6d6672c1 --- /dev/null +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types @@ -0,0 +1,35 @@ +=== tests/cases/compiler/a.ts === +module M { +>M : typeof M + + export var X = 1; +>X : number +} +interface Navigator { +>Navigator : Navigator + + getGamepads(func?: any): any; +>getGamepads : (func?: any) => any +>func : any + + webkitGetGamepads(func?: any): any +>webkitGetGamepads : (func?: any) => any +>func : any + + msGetGamepads(func?: any): any; +>msGetGamepads : (func?: any) => any +>func : any + + webkitGamepads(func?: any): any; +>webkitGamepads : (func?: any) => any +>func : any +} + +=== tests/cases/compiler/b.ts === +module m1 { +>m1 : typeof m1 + + export class c1 { +>c1 : c1 + } +} diff --git a/tests/cases/compiler/sourceMapWithMultipleFilesWithFileEndingWithInterface.ts b/tests/cases/compiler/sourceMapWithMultipleFilesWithFileEndingWithInterface.ts new file mode 100644 index 0000000000..e7634a22b6 --- /dev/null +++ b/tests/cases/compiler/sourceMapWithMultipleFilesWithFileEndingWithInterface.ts @@ -0,0 +1,18 @@ +// @out: fooResult.js +// @sourcemap: true +// @Filename: a.ts +module M { + export var X = 1; +} +interface Navigator { + getGamepads(func?: any): any; + webkitGetGamepads(func?: any): any + msGetGamepads(func?: any): any; + webkitGamepads(func?: any): any; +} + +// @Filename: b.ts +module m1 { + export class c1 { + } +} \ No newline at end of file