diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8baeae5d84a..25bfa40153d 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1208,7 +1208,7 @@ namespace ts { // SyntaxKind.UnparsedSource function emitUnparsedSource(unparsed: UnparsedSource) { - writer.rawWrite(unparsed.text); + writer.rawWrite(unparsed.text.substr(unparsed.pos)); } // @@ -3020,8 +3020,8 @@ namespace ts { } } - function emitShebangIfNeeded(sourceFileOrBundle: Bundle | SourceFile) { - if (isSourceFile(sourceFileOrBundle)) { + function emitShebangIfNeeded(sourceFileOrBundle: Bundle | SourceFile | UnparsedSource) { + if (isSourceFile(sourceFileOrBundle) || isUnparsedSource(sourceFileOrBundle)) { const shebang = getShebang(sourceFileOrBundle.text); if (shebang) { writeComment(shebang); @@ -3030,10 +3030,16 @@ namespace ts { } } else { + for (const prepend of sourceFileOrBundle.prepends) { + Debug.assertNode(prepend, isUnparsedSource); + if (emitShebangIfNeeded(prepend as UnparsedSource)) { + return true; + } + } for (const sourceFile of sourceFileOrBundle.sourceFiles) { // Emit only the first encountered shebang if (emitShebangIfNeeded(sourceFile)) { - break; + return true; } } } @@ -4346,7 +4352,8 @@ namespace ts { writer.getLine(), writer.getColumn(), parsed, - node.sourceMapPath!); + node.sourceMapPath!, + node.pos && node.getLineAndCharacterOfPosition(node.pos).line); } pipelinePhase(hint, node); } diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index ab15bccafb0..960cb2e7281 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2648,6 +2648,9 @@ namespace ts { node.sourceMapPath = mapPathOrType; node.sourceMapText = map; } + const text = node.text; + node.pos = isShebangTrivia(text, 0) ? skipTrivia(text, 0, /*stopAfterLineBreak*/ true) : 0; + node.getLineAndCharacterOfPosition = pos => getLineAndCharacterOfPosition(node, pos); return node; } export function createInputFiles( diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 4f3eba37296..c5b51dc3aae 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -623,13 +623,15 @@ namespace ts { const shebangTriviaRegex = /^#!.*/; - function isShebangTrivia(text: string, pos: number) { + /*@internal*/ + export function isShebangTrivia(text: string, pos: number) { // Shebangs check must only be done at the start of the file Debug.assert(pos === 0); return shebangTriviaRegex.test(text); } - function scanShebangTrivia(text: string, pos: number) { + /*@internal*/ + export function scanShebangTrivia(text: string, pos: number) { const shebang = shebangTriviaRegex.exec(text)![0]; pos = pos + shebang.length; return pos; diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index c2597d688d8..2799847852d 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -140,7 +140,7 @@ namespace ts { exit(); } - function appendSourceMap(generatedLine: number, generatedCharacter: number, map: RawSourceMap, sourceMapPath: string) { + function appendSourceMap(generatedLine: number, generatedCharacter: number, map: RawSourceMap, sourceMapPath: string, startLine: number) { Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); enter(); @@ -149,6 +149,9 @@ namespace ts { let nameIndexToNewNameIndexMap: number[] | undefined; const mappingIterator = decodeMappings(map.mappings); for (let { value: raw, done } = mappingIterator.next(); !done; { value: raw, done } = mappingIterator.next()) { + if (raw.generatedLine < startLine) { + continue; + } // Then reencode all the updated mappings into the overall map let newSourceIndex: number | undefined; let newSourceLine: number | undefined; @@ -178,8 +181,9 @@ namespace ts { } } - const newGeneratedLine = raw.generatedLine + generatedLine; - const newGeneratedCharacter = raw.generatedLine === 0 ? raw.generatedCharacter + generatedCharacter : raw.generatedCharacter; + const rawGeneratedLine = raw.generatedLine - startLine; + const newGeneratedLine = rawGeneratedLine + generatedLine; + const newGeneratedCharacter = rawGeneratedLine === 0 ? raw.generatedCharacter + generatedCharacter : raw.generatedCharacter; addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex); } exit(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c460b948347..bd4c2c86748 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2777,6 +2777,9 @@ namespace ts { text: string; sourceMapPath?: string; sourceMapText?: string; + // Adding this to satisfy services, fix later + /*@internal*/ + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; } export interface JsonSourceFile extends SourceFile { @@ -5528,7 +5531,7 @@ namespace ts { /** * Appends a source map. */ - appendSourceMap(generatedLine: number, generatedCharacter: number, sourceMap: RawSourceMap, sourceMapPath: string): void; + appendSourceMap(generatedLine: number, generatedCharacter: number, sourceMap: RawSourceMap, sourceMapPath: string, startLine: number): void; /** * Gets the source map as a `RawSourceMap` object. */ diff --git a/tests/baselines/reference/outFile-shebang-in-all-projects.js b/tests/baselines/reference/outFile-shebang-in-all-projects.js index ff5c8091183..187be62d64f 100644 --- a/tests/baselines/reference/outFile-shebang-in-all-projects.js +++ b/tests/baselines/reference/outFile-shebang-in-all-projects.js @@ -732,7 +732,6 @@ namespace N { //// [/src/third/thirdjs/output/third-output.d.ts] -#!someshebang third third_part1 #!someshebang first first_PART1 interface TheFirst { none: any; @@ -743,7 +742,6 @@ interface NoJsForHereEither { } declare function f(): string; //# sourceMappingURL=first-output.d.ts.map -#!someshebang second second_part1 declare namespace N { } declare namespace N { @@ -756,7 +754,7 @@ declare var c: C; //# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.d.ts.map] -{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":";;ACCA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;;;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACXD,cAAM,CAAC;IACH,WAAW;CAGd;;AJHD,QAAA,IAAI,CAAC,GAAU,CAAC"} +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":";ACCA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACXD,cAAM,CAAC;IACH,WAAW;CAGd;;AJHD,QAAA,IAAI,CAAC,GAAU,CAAC"} //// [/src/third/thirdjs/output/third-output.d.ts.map.baseline.txt] =================================================================== @@ -769,7 +767,6 @@ sources: ../../third_part1.ts,../../../first/first_PART1.ts,../../../first/first emittedFile:/src/third/thirdjs/output/third-output.d.ts sourceFile:../../../first/first_PART1.ts ------------------------------------------------------------------- ->>>#!someshebang third third_part1 >>>#!someshebang first first_PART1 >>>interface TheFirst { 1 > @@ -779,9 +776,9 @@ sourceFile:../../../first/first_PART1.ts > 2 >interface 3 > TheFirst -1 >Emitted(3, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(3, 11) Source(2, 11) + SourceIndex(1) -3 >Emitted(3, 19) Source(2, 19) + SourceIndex(1) +1 >Emitted(2, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(2, 11) Source(2, 11) + SourceIndex(1) +3 >Emitted(2, 19) Source(2, 19) + SourceIndex(1) --- >>> none: any; 1 >^^^^ @@ -795,18 +792,18 @@ sourceFile:../../../first/first_PART1.ts 3 > : 4 > any 5 > ; -1 >Emitted(4, 5) Source(3, 5) + SourceIndex(1) -2 >Emitted(4, 9) Source(3, 9) + SourceIndex(1) -3 >Emitted(4, 11) Source(3, 11) + SourceIndex(1) -4 >Emitted(4, 14) Source(3, 14) + SourceIndex(1) -5 >Emitted(4, 15) Source(3, 15) + SourceIndex(1) +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(1) +2 >Emitted(3, 9) Source(3, 9) + SourceIndex(1) +3 >Emitted(3, 11) Source(3, 11) + SourceIndex(1) +4 >Emitted(3, 14) Source(3, 14) + SourceIndex(1) +5 >Emitted(3, 15) Source(3, 15) + SourceIndex(1) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(5, 2) Source(4, 2) + SourceIndex(1) +1 >Emitted(4, 2) Source(4, 2) + SourceIndex(1) --- >>>declare const s = "Hello, world"; 1-> @@ -823,12 +820,12 @@ sourceFile:../../../first/first_PART1.ts 4 > s 5 > = "Hello, world" 6 > ; -1->Emitted(6, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(6, 9) Source(6, 1) + SourceIndex(1) -3 >Emitted(6, 15) Source(6, 7) + SourceIndex(1) -4 >Emitted(6, 16) Source(6, 8) + SourceIndex(1) -5 >Emitted(6, 33) Source(6, 25) + SourceIndex(1) -6 >Emitted(6, 34) Source(6, 26) + SourceIndex(1) +1->Emitted(5, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(5, 9) Source(6, 1) + SourceIndex(1) +3 >Emitted(5, 15) Source(6, 7) + SourceIndex(1) +4 >Emitted(5, 16) Source(6, 8) + SourceIndex(1) +5 >Emitted(5, 33) Source(6, 25) + SourceIndex(1) +6 >Emitted(5, 34) Source(6, 26) + SourceIndex(1) --- >>>interface NoJsForHereEither { 1 > @@ -839,9 +836,9 @@ sourceFile:../../../first/first_PART1.ts > 2 >interface 3 > NoJsForHereEither -1 >Emitted(7, 1) Source(8, 1) + SourceIndex(1) -2 >Emitted(7, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(7, 28) Source(8, 28) + SourceIndex(1) +1 >Emitted(6, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(6, 11) Source(8, 11) + SourceIndex(1) +3 >Emitted(6, 28) Source(8, 28) + SourceIndex(1) --- >>> none: any; 1 >^^^^ @@ -855,18 +852,18 @@ sourceFile:../../../first/first_PART1.ts 3 > : 4 > any 5 > ; -1 >Emitted(8, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(8, 9) Source(9, 9) + SourceIndex(1) -3 >Emitted(8, 11) Source(9, 11) + SourceIndex(1) -4 >Emitted(8, 14) Source(9, 14) + SourceIndex(1) -5 >Emitted(8, 15) Source(9, 15) + SourceIndex(1) +1 >Emitted(7, 5) Source(9, 5) + SourceIndex(1) +2 >Emitted(7, 9) Source(9, 9) + SourceIndex(1) +3 >Emitted(7, 11) Source(9, 11) + SourceIndex(1) +4 >Emitted(7, 14) Source(9, 14) + SourceIndex(1) +5 >Emitted(7, 15) Source(9, 15) + SourceIndex(1) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(9, 2) Source(10, 2) + SourceIndex(1) +1 >Emitted(8, 2) Source(10, 2) + SourceIndex(1) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.d.ts @@ -884,17 +881,16 @@ sourceFile:../../../first/first_part3.ts 4 > () { > return "JS does hoists"; > } -1->Emitted(10, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(10, 18) Source(1, 10) + SourceIndex(2) -3 >Emitted(10, 19) Source(1, 11) + SourceIndex(2) -4 >Emitted(10, 30) Source(3, 2) + SourceIndex(2) +1->Emitted(9, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(9, 18) Source(1, 10) + SourceIndex(2) +3 >Emitted(9, 19) Source(1, 11) + SourceIndex(2) +4 >Emitted(9, 30) Source(3, 2) + SourceIndex(2) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.d.ts sourceFile:../../../second/second_part1.ts ------------------------------------------------------------------- >>>//# sourceMappingURL=first-output.d.ts.map ->>>#!someshebang second second_part1 >>>declare namespace N { 1-> 2 >^^^^^^^^^^^^^^^^^^ @@ -905,10 +901,10 @@ sourceFile:../../../second/second_part1.ts 2 >namespace 3 > N 4 > -1->Emitted(13, 1) Source(2, 1) + SourceIndex(3) -2 >Emitted(13, 19) Source(2, 11) + SourceIndex(3) -3 >Emitted(13, 20) Source(2, 12) + SourceIndex(3) -4 >Emitted(13, 21) Source(2, 13) + SourceIndex(3) +1->Emitted(11, 1) Source(2, 1) + SourceIndex(3) +2 >Emitted(11, 19) Source(2, 11) + SourceIndex(3) +3 >Emitted(11, 20) Source(2, 12) + SourceIndex(3) +4 >Emitted(11, 21) Source(2, 13) + SourceIndex(3) --- >>>} 1 >^ @@ -916,7 +912,7 @@ sourceFile:../../../second/second_part1.ts 1 >{ > // Comment text >} -1 >Emitted(14, 2) Source(4, 2) + SourceIndex(3) +1 >Emitted(12, 2) Source(4, 2) + SourceIndex(3) --- >>>declare namespace N { 1-> @@ -929,10 +925,10 @@ sourceFile:../../../second/second_part1.ts 2 >namespace 3 > N 4 > -1->Emitted(15, 1) Source(6, 1) + SourceIndex(3) -2 >Emitted(15, 19) Source(6, 11) + SourceIndex(3) -3 >Emitted(15, 20) Source(6, 12) + SourceIndex(3) -4 >Emitted(15, 21) Source(6, 13) + SourceIndex(3) +1->Emitted(13, 1) Source(6, 1) + SourceIndex(3) +2 >Emitted(13, 19) Source(6, 11) + SourceIndex(3) +3 >Emitted(13, 20) Source(6, 12) + SourceIndex(3) +4 >Emitted(13, 21) Source(6, 13) + SourceIndex(3) --- >>>} 1 >^ @@ -944,7 +940,7 @@ sourceFile:../../../second/second_part1.ts > > f(); >} -1 >Emitted(16, 2) Source(12, 2) + SourceIndex(3) +1 >Emitted(14, 2) Source(12, 2) + SourceIndex(3) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.d.ts @@ -958,9 +954,9 @@ sourceFile:../../../second/second_part2.ts 1-> 2 >class 3 > C -1->Emitted(17, 1) Source(1, 1) + SourceIndex(4) -2 >Emitted(17, 15) Source(1, 7) + SourceIndex(4) -3 >Emitted(17, 16) Source(1, 8) + SourceIndex(4) +1->Emitted(15, 1) Source(1, 1) + SourceIndex(4) +2 >Emitted(15, 15) Source(1, 7) + SourceIndex(4) +3 >Emitted(15, 16) Source(1, 8) + SourceIndex(4) --- >>> doSomething(): void; 1->^^^^ @@ -968,8 +964,8 @@ sourceFile:../../../second/second_part2.ts 1-> { > 2 > doSomething -1->Emitted(18, 5) Source(2, 5) + SourceIndex(4) -2 >Emitted(18, 16) Source(2, 16) + SourceIndex(4) +1->Emitted(16, 5) Source(2, 5) + SourceIndex(4) +2 >Emitted(16, 16) Source(2, 16) + SourceIndex(4) --- >>>} 1 >^ @@ -978,7 +974,7 @@ sourceFile:../../../second/second_part2.ts > console.log("something got done"); > } >} -1 >Emitted(19, 2) Source(5, 2) + SourceIndex(4) +1 >Emitted(17, 2) Source(5, 2) + SourceIndex(4) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.d.ts @@ -1000,17 +996,16 @@ sourceFile:../../third_part1.ts 4 > c 5 > = new C() 6 > ; -1->Emitted(21, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(21, 9) Source(2, 1) + SourceIndex(0) -3 >Emitted(21, 13) Source(2, 5) + SourceIndex(0) -4 >Emitted(21, 14) Source(2, 6) + SourceIndex(0) -5 >Emitted(21, 17) Source(2, 16) + SourceIndex(0) -6 >Emitted(21, 18) Source(2, 17) + SourceIndex(0) +1->Emitted(19, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(19, 9) Source(2, 1) + SourceIndex(0) +3 >Emitted(19, 13) Source(2, 5) + SourceIndex(0) +4 >Emitted(19, 14) Source(2, 6) + SourceIndex(0) +5 >Emitted(19, 17) Source(2, 16) + SourceIndex(0) +6 >Emitted(19, 18) Source(2, 17) + SourceIndex(0) --- >>>//# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.js] -#!someshebang third third_part1 #!someshebang first first_PART1 var s = "Hello, world"; console.log(s); @@ -1019,7 +1014,6 @@ function f() { return "JS does hoists"; } //# sourceMappingURL=first-output.js.map -#!someshebang second second_part1 var N; (function (N) { function f() { @@ -1041,7 +1035,7 @@ c.doSomething(); //# sourceMappingURL=third-output.js.map //// [/src/third/thirdjs/output/third-output.js.map] -{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":";;ACKA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACDjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;;;ACGD,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACXD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;;ALHD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":";ACKA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACDjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;;ACGD,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACXD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;;ALHD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} //// [/src/third/thirdjs/output/third-output.js.map.baseline.txt] =================================================================== @@ -1054,7 +1048,6 @@ sources: ../../third_part1.ts,../../../first/first_PART1.ts,../../../first/first emittedFile:/src/third/thirdjs/output/third-output.js sourceFile:../../../first/first_PART1.ts ------------------------------------------------------------------- ->>>#!someshebang third third_part1 >>>#!someshebang first first_PART1 >>>var s = "Hello, world"; 1 > @@ -1074,12 +1067,12 @@ sourceFile:../../../first/first_PART1.ts 4 > = 5 > "Hello, world" 6 > ; -1 >Emitted(3, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(3, 5) Source(6, 7) + SourceIndex(1) -3 >Emitted(3, 6) Source(6, 8) + SourceIndex(1) -4 >Emitted(3, 9) Source(6, 11) + SourceIndex(1) -5 >Emitted(3, 23) Source(6, 25) + SourceIndex(1) -6 >Emitted(3, 24) Source(6, 26) + SourceIndex(1) +1 >Emitted(2, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(2, 5) Source(6, 7) + SourceIndex(1) +3 >Emitted(2, 6) Source(6, 8) + SourceIndex(1) +4 >Emitted(2, 9) Source(6, 11) + SourceIndex(1) +5 >Emitted(2, 23) Source(6, 25) + SourceIndex(1) +6 >Emitted(2, 24) Source(6, 26) + SourceIndex(1) --- >>>console.log(s); 1 > @@ -1105,14 +1098,14 @@ sourceFile:../../../first/first_PART1.ts 6 > s 7 > ) 8 > ; -1 >Emitted(4, 1) Source(12, 1) + SourceIndex(1) -2 >Emitted(4, 8) Source(12, 8) + SourceIndex(1) -3 >Emitted(4, 9) Source(12, 9) + SourceIndex(1) -4 >Emitted(4, 12) Source(12, 12) + SourceIndex(1) -5 >Emitted(4, 13) Source(12, 13) + SourceIndex(1) -6 >Emitted(4, 14) Source(12, 14) + SourceIndex(1) -7 >Emitted(4, 15) Source(12, 15) + SourceIndex(1) -8 >Emitted(4, 16) Source(12, 16) + SourceIndex(1) +1 >Emitted(3, 1) Source(12, 1) + SourceIndex(1) +2 >Emitted(3, 8) Source(12, 8) + SourceIndex(1) +3 >Emitted(3, 9) Source(12, 9) + SourceIndex(1) +4 >Emitted(3, 12) Source(12, 12) + SourceIndex(1) +5 >Emitted(3, 13) Source(12, 13) + SourceIndex(1) +6 >Emitted(3, 14) Source(12, 14) + SourceIndex(1) +7 >Emitted(3, 15) Source(12, 15) + SourceIndex(1) +8 >Emitted(3, 16) Source(12, 16) + SourceIndex(1) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js @@ -1138,15 +1131,15 @@ sourceFile:../../../first/first_part2.ts 7 > () 8 > ) 9 > ; -1->Emitted(5, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(5, 8) Source(2, 8) + SourceIndex(2) -3 >Emitted(5, 9) Source(2, 9) + SourceIndex(2) -4 >Emitted(5, 12) Source(2, 12) + SourceIndex(2) -5 >Emitted(5, 13) Source(2, 13) + SourceIndex(2) -6 >Emitted(5, 14) Source(2, 14) + SourceIndex(2) -7 >Emitted(5, 16) Source(2, 16) + SourceIndex(2) -8 >Emitted(5, 17) Source(2, 17) + SourceIndex(2) -9 >Emitted(5, 18) Source(2, 18) + SourceIndex(2) +1->Emitted(4, 1) Source(2, 1) + SourceIndex(2) +2 >Emitted(4, 8) Source(2, 8) + SourceIndex(2) +3 >Emitted(4, 9) Source(2, 9) + SourceIndex(2) +4 >Emitted(4, 12) Source(2, 12) + SourceIndex(2) +5 >Emitted(4, 13) Source(2, 13) + SourceIndex(2) +6 >Emitted(4, 14) Source(2, 14) + SourceIndex(2) +7 >Emitted(4, 16) Source(2, 16) + SourceIndex(2) +8 >Emitted(4, 17) Source(2, 17) + SourceIndex(2) +9 >Emitted(4, 18) Source(2, 18) + SourceIndex(2) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js @@ -1160,9 +1153,9 @@ sourceFile:../../../first/first_part3.ts 1 > 2 >function 3 > f -1 >Emitted(6, 1) Source(1, 1) + SourceIndex(3) -2 >Emitted(6, 10) Source(1, 10) + SourceIndex(3) -3 >Emitted(6, 11) Source(1, 11) + SourceIndex(3) +1 >Emitted(5, 1) Source(1, 1) + SourceIndex(3) +2 >Emitted(5, 10) Source(1, 10) + SourceIndex(3) +3 >Emitted(5, 11) Source(1, 11) + SourceIndex(3) --- >>> return "JS does hoists"; 1->^^^^ @@ -1174,10 +1167,10 @@ sourceFile:../../../first/first_part3.ts 2 > return 3 > "JS does hoists" 4 > ; -1->Emitted(7, 5) Source(2, 5) + SourceIndex(3) -2 >Emitted(7, 12) Source(2, 12) + SourceIndex(3) -3 >Emitted(7, 28) Source(2, 28) + SourceIndex(3) -4 >Emitted(7, 29) Source(2, 29) + SourceIndex(3) +1->Emitted(6, 5) Source(2, 5) + SourceIndex(3) +2 >Emitted(6, 12) Source(2, 12) + SourceIndex(3) +3 >Emitted(6, 28) Source(2, 28) + SourceIndex(3) +4 >Emitted(6, 29) Source(2, 29) + SourceIndex(3) --- >>>} 1 > @@ -1186,15 +1179,14 @@ sourceFile:../../../first/first_part3.ts 1 > > 2 >} -1 >Emitted(8, 1) Source(3, 1) + SourceIndex(3) -2 >Emitted(8, 2) Source(3, 2) + SourceIndex(3) +1 >Emitted(7, 1) Source(3, 1) + SourceIndex(3) +2 >Emitted(7, 2) Source(3, 2) + SourceIndex(3) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js sourceFile:../../../second/second_part1.ts ------------------------------------------------------------------- >>>//# sourceMappingURL=first-output.js.map ->>>#!someshebang second second_part1 >>>var N; 1-> 2 >^^^^ @@ -1216,10 +1208,10 @@ sourceFile:../../../second/second_part1.ts > > f(); > } -1->Emitted(11, 1) Source(6, 1) + SourceIndex(4) -2 >Emitted(11, 5) Source(6, 11) + SourceIndex(4) -3 >Emitted(11, 6) Source(6, 12) + SourceIndex(4) -4 >Emitted(11, 7) Source(12, 2) + SourceIndex(4) +1->Emitted(9, 1) Source(6, 1) + SourceIndex(4) +2 >Emitted(9, 5) Source(6, 11) + SourceIndex(4) +3 >Emitted(9, 6) Source(6, 12) + SourceIndex(4) +4 >Emitted(9, 7) Source(12, 2) + SourceIndex(4) --- >>>(function (N) { 1-> @@ -1229,9 +1221,9 @@ sourceFile:../../../second/second_part1.ts 1-> 2 >namespace 3 > N -1->Emitted(12, 1) Source(6, 1) + SourceIndex(4) -2 >Emitted(12, 12) Source(6, 11) + SourceIndex(4) -3 >Emitted(12, 13) Source(6, 12) + SourceIndex(4) +1->Emitted(10, 1) Source(6, 1) + SourceIndex(4) +2 >Emitted(10, 12) Source(6, 11) + SourceIndex(4) +3 >Emitted(10, 13) Source(6, 12) + SourceIndex(4) --- >>> function f() { 1->^^^^ @@ -1242,9 +1234,9 @@ sourceFile:../../../second/second_part1.ts > 2 > function 3 > f -1->Emitted(13, 5) Source(7, 5) + SourceIndex(4) -2 >Emitted(13, 14) Source(7, 14) + SourceIndex(4) -3 >Emitted(13, 15) Source(7, 15) + SourceIndex(4) +1->Emitted(11, 5) Source(7, 5) + SourceIndex(4) +2 >Emitted(11, 14) Source(7, 14) + SourceIndex(4) +3 >Emitted(11, 15) Source(7, 15) + SourceIndex(4) --- >>> console.log('testing'); 1->^^^^^^^^ @@ -1264,14 +1256,14 @@ sourceFile:../../../second/second_part1.ts 6 > 'testing' 7 > ) 8 > ; -1->Emitted(14, 9) Source(8, 9) + SourceIndex(4) -2 >Emitted(14, 16) Source(8, 16) + SourceIndex(4) -3 >Emitted(14, 17) Source(8, 17) + SourceIndex(4) -4 >Emitted(14, 20) Source(8, 20) + SourceIndex(4) -5 >Emitted(14, 21) Source(8, 21) + SourceIndex(4) -6 >Emitted(14, 30) Source(8, 30) + SourceIndex(4) -7 >Emitted(14, 31) Source(8, 31) + SourceIndex(4) -8 >Emitted(14, 32) Source(8, 32) + SourceIndex(4) +1->Emitted(12, 9) Source(8, 9) + SourceIndex(4) +2 >Emitted(12, 16) Source(8, 16) + SourceIndex(4) +3 >Emitted(12, 17) Source(8, 17) + SourceIndex(4) +4 >Emitted(12, 20) Source(8, 20) + SourceIndex(4) +5 >Emitted(12, 21) Source(8, 21) + SourceIndex(4) +6 >Emitted(12, 30) Source(8, 30) + SourceIndex(4) +7 >Emitted(12, 31) Source(8, 31) + SourceIndex(4) +8 >Emitted(12, 32) Source(8, 32) + SourceIndex(4) --- >>> } 1 >^^^^ @@ -1280,8 +1272,8 @@ sourceFile:../../../second/second_part1.ts 1 > > 2 > } -1 >Emitted(15, 5) Source(9, 5) + SourceIndex(4) -2 >Emitted(15, 6) Source(9, 6) + SourceIndex(4) +1 >Emitted(13, 5) Source(9, 5) + SourceIndex(4) +2 >Emitted(13, 6) Source(9, 6) + SourceIndex(4) --- >>> f(); 1->^^^^ @@ -1295,10 +1287,10 @@ sourceFile:../../../second/second_part1.ts 2 > f 3 > () 4 > ; -1->Emitted(16, 5) Source(11, 5) + SourceIndex(4) -2 >Emitted(16, 6) Source(11, 6) + SourceIndex(4) -3 >Emitted(16, 8) Source(11, 8) + SourceIndex(4) -4 >Emitted(16, 9) Source(11, 9) + SourceIndex(4) +1->Emitted(14, 5) Source(11, 5) + SourceIndex(4) +2 >Emitted(14, 6) Source(11, 6) + SourceIndex(4) +3 >Emitted(14, 8) Source(11, 8) + SourceIndex(4) +4 >Emitted(14, 9) Source(11, 9) + SourceIndex(4) --- >>>})(N || (N = {})); 1-> @@ -1323,13 +1315,13 @@ sourceFile:../../../second/second_part1.ts > > f(); > } -1->Emitted(17, 1) Source(12, 1) + SourceIndex(4) -2 >Emitted(17, 2) Source(12, 2) + SourceIndex(4) -3 >Emitted(17, 4) Source(6, 11) + SourceIndex(4) -4 >Emitted(17, 5) Source(6, 12) + SourceIndex(4) -5 >Emitted(17, 10) Source(6, 11) + SourceIndex(4) -6 >Emitted(17, 11) Source(6, 12) + SourceIndex(4) -7 >Emitted(17, 19) Source(12, 2) + SourceIndex(4) +1->Emitted(15, 1) Source(12, 1) + SourceIndex(4) +2 >Emitted(15, 2) Source(12, 2) + SourceIndex(4) +3 >Emitted(15, 4) Source(6, 11) + SourceIndex(4) +4 >Emitted(15, 5) Source(6, 12) + SourceIndex(4) +5 >Emitted(15, 10) Source(6, 11) + SourceIndex(4) +6 >Emitted(15, 11) Source(6, 12) + SourceIndex(4) +7 >Emitted(15, 19) Source(12, 2) + SourceIndex(4) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js @@ -1339,13 +1331,13 @@ sourceFile:../../../second/second_part2.ts 1-> 2 >^^^^^^^^^^^^^^^^^^^-> 1-> -1->Emitted(18, 1) Source(1, 1) + SourceIndex(5) +1->Emitted(16, 1) Source(1, 1) + SourceIndex(5) --- >>> function C() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(19, 5) Source(1, 1) + SourceIndex(5) +1->Emitted(17, 5) Source(1, 1) + SourceIndex(5) --- >>> } 1->^^^^ @@ -1357,8 +1349,8 @@ sourceFile:../../../second/second_part2.ts > } > 2 > } -1->Emitted(20, 5) Source(5, 1) + SourceIndex(5) -2 >Emitted(20, 6) Source(5, 2) + SourceIndex(5) +1->Emitted(18, 5) Source(5, 1) + SourceIndex(5) +2 >Emitted(18, 6) Source(5, 2) + SourceIndex(5) --- >>> C.prototype.doSomething = function () { 1->^^^^ @@ -1368,9 +1360,9 @@ sourceFile:../../../second/second_part2.ts 1-> 2 > doSomething 3 > -1->Emitted(21, 5) Source(2, 5) + SourceIndex(5) -2 >Emitted(21, 28) Source(2, 16) + SourceIndex(5) -3 >Emitted(21, 31) Source(2, 5) + SourceIndex(5) +1->Emitted(19, 5) Source(2, 5) + SourceIndex(5) +2 >Emitted(19, 28) Source(2, 16) + SourceIndex(5) +3 >Emitted(19, 31) Source(2, 5) + SourceIndex(5) --- >>> console.log("something got done"); 1->^^^^^^^^ @@ -1390,14 +1382,14 @@ sourceFile:../../../second/second_part2.ts 6 > "something got done" 7 > ) 8 > ; -1->Emitted(22, 9) Source(3, 9) + SourceIndex(5) -2 >Emitted(22, 16) Source(3, 16) + SourceIndex(5) -3 >Emitted(22, 17) Source(3, 17) + SourceIndex(5) -4 >Emitted(22, 20) Source(3, 20) + SourceIndex(5) -5 >Emitted(22, 21) Source(3, 21) + SourceIndex(5) -6 >Emitted(22, 41) Source(3, 41) + SourceIndex(5) -7 >Emitted(22, 42) Source(3, 42) + SourceIndex(5) -8 >Emitted(22, 43) Source(3, 43) + SourceIndex(5) +1->Emitted(20, 9) Source(3, 9) + SourceIndex(5) +2 >Emitted(20, 16) Source(3, 16) + SourceIndex(5) +3 >Emitted(20, 17) Source(3, 17) + SourceIndex(5) +4 >Emitted(20, 20) Source(3, 20) + SourceIndex(5) +5 >Emitted(20, 21) Source(3, 21) + SourceIndex(5) +6 >Emitted(20, 41) Source(3, 41) + SourceIndex(5) +7 >Emitted(20, 42) Source(3, 42) + SourceIndex(5) +8 >Emitted(20, 43) Source(3, 43) + SourceIndex(5) --- >>> }; 1 >^^^^ @@ -1406,8 +1398,8 @@ sourceFile:../../../second/second_part2.ts 1 > > 2 > } -1 >Emitted(23, 5) Source(4, 5) + SourceIndex(5) -2 >Emitted(23, 6) Source(4, 6) + SourceIndex(5) +1 >Emitted(21, 5) Source(4, 5) + SourceIndex(5) +2 >Emitted(21, 6) Source(4, 6) + SourceIndex(5) --- >>> return C; 1->^^^^ @@ -1415,8 +1407,8 @@ sourceFile:../../../second/second_part2.ts 1-> > 2 > } -1->Emitted(24, 5) Source(5, 1) + SourceIndex(5) -2 >Emitted(24, 13) Source(5, 2) + SourceIndex(5) +1->Emitted(22, 5) Source(5, 1) + SourceIndex(5) +2 >Emitted(22, 13) Source(5, 2) + SourceIndex(5) --- >>>}()); 1 > @@ -1432,10 +1424,10 @@ sourceFile:../../../second/second_part2.ts > console.log("something got done"); > } > } -1 >Emitted(25, 1) Source(5, 1) + SourceIndex(5) -2 >Emitted(25, 2) Source(5, 2) + SourceIndex(5) -3 >Emitted(25, 2) Source(1, 1) + SourceIndex(5) -4 >Emitted(25, 6) Source(5, 2) + SourceIndex(5) +1 >Emitted(23, 1) Source(5, 1) + SourceIndex(5) +2 >Emitted(23, 2) Source(5, 2) + SourceIndex(5) +3 >Emitted(23, 2) Source(1, 1) + SourceIndex(5) +4 >Emitted(23, 6) Source(5, 2) + SourceIndex(5) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js @@ -1461,14 +1453,14 @@ sourceFile:../../third_part1.ts 6 > C 7 > () 8 > ; -1->Emitted(27, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(27, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(27, 6) Source(2, 6) + SourceIndex(0) -4 >Emitted(27, 9) Source(2, 9) + SourceIndex(0) -5 >Emitted(27, 13) Source(2, 13) + SourceIndex(0) -6 >Emitted(27, 14) Source(2, 14) + SourceIndex(0) -7 >Emitted(27, 16) Source(2, 16) + SourceIndex(0) -8 >Emitted(27, 17) Source(2, 17) + SourceIndex(0) +1->Emitted(25, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(25, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(25, 13) Source(2, 13) + SourceIndex(0) +6 >Emitted(25, 14) Source(2, 14) + SourceIndex(0) +7 >Emitted(25, 16) Source(2, 16) + SourceIndex(0) +8 >Emitted(25, 17) Source(2, 17) + SourceIndex(0) --- >>>c.doSomething(); 1-> @@ -1485,12 +1477,12 @@ sourceFile:../../third_part1.ts 4 > doSomething 5 > () 6 > ; -1->Emitted(28, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(28, 2) Source(3, 2) + SourceIndex(0) -3 >Emitted(28, 3) Source(3, 3) + SourceIndex(0) -4 >Emitted(28, 14) Source(3, 14) + SourceIndex(0) -5 >Emitted(28, 16) Source(3, 16) + SourceIndex(0) -6 >Emitted(28, 17) Source(3, 17) + SourceIndex(0) +1->Emitted(26, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(3, 2) + SourceIndex(0) +3 >Emitted(26, 3) Source(3, 3) + SourceIndex(0) +4 >Emitted(26, 14) Source(3, 14) + SourceIndex(0) +5 >Emitted(26, 16) Source(3, 16) + SourceIndex(0) +6 >Emitted(26, 17) Source(3, 17) + SourceIndex(0) --- >>>//# sourceMappingURL=third-output.js.map diff --git a/tests/baselines/reference/outFile-shebang-in-only-one-dependency-project.js b/tests/baselines/reference/outFile-shebang-in-only-one-dependency-project.js index 6dd45721efa..74a913e5f23 100644 --- a/tests/baselines/reference/outFile-shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/outFile-shebang-in-only-one-dependency-project.js @@ -705,6 +705,7 @@ namespace N { //// [/src/third/thirdjs/output/third-output.d.ts] +#!someshebang second second_part1 interface TheFirst { none: any; } @@ -714,7 +715,6 @@ interface NoJsForHereEither { } declare function f(): string; //# sourceMappingURL=first-output.d.ts.map -#!someshebang second second_part1 declare namespace N { } declare namespace N { @@ -727,7 +727,7 @@ declare var c: C; //# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.d.ts.map] -{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":"ACAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;;;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACXD,cAAM,CAAC;IACH,WAAW;CAGd;;AJJD,QAAA,IAAI,CAAC,GAAU,CAAC"} +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":";ACAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACXD,cAAM,CAAC;IACH,WAAW;CAGd;;AJJD,QAAA,IAAI,CAAC,GAAU,CAAC"} //// [/src/third/thirdjs/output/third-output.d.ts.map.baseline.txt] =================================================================== @@ -740,6 +740,7 @@ sources: ../../third_part1.ts,../../../first/first_PART1.ts,../../../first/first emittedFile:/src/third/thirdjs/output/third-output.d.ts sourceFile:../../../first/first_PART1.ts ------------------------------------------------------------------- +>>>#!someshebang second second_part1 >>>interface TheFirst { 1 > 2 >^^^^^^^^^^ @@ -747,9 +748,9 @@ sourceFile:../../../first/first_PART1.ts 1 > 2 >interface 3 > TheFirst -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(1, 11) Source(1, 11) + SourceIndex(1) -3 >Emitted(1, 19) Source(1, 19) + SourceIndex(1) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(2, 11) Source(1, 11) + SourceIndex(1) +3 >Emitted(2, 19) Source(1, 19) + SourceIndex(1) --- >>> none: any; 1 >^^^^ @@ -763,18 +764,18 @@ sourceFile:../../../first/first_PART1.ts 3 > : 4 > any 5 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(1) -2 >Emitted(2, 9) Source(2, 9) + SourceIndex(1) -3 >Emitted(2, 11) Source(2, 11) + SourceIndex(1) -4 >Emitted(2, 14) Source(2, 14) + SourceIndex(1) -5 >Emitted(2, 15) Source(2, 15) + SourceIndex(1) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(1) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(1) +3 >Emitted(3, 11) Source(2, 11) + SourceIndex(1) +4 >Emitted(3, 14) Source(2, 14) + SourceIndex(1) +5 >Emitted(3, 15) Source(2, 15) + SourceIndex(1) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(3, 2) Source(3, 2) + SourceIndex(1) +1 >Emitted(4, 2) Source(3, 2) + SourceIndex(1) --- >>>declare const s = "Hello, world"; 1-> @@ -791,12 +792,12 @@ sourceFile:../../../first/first_PART1.ts 4 > s 5 > = "Hello, world" 6 > ; -1->Emitted(4, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(4, 9) Source(5, 1) + SourceIndex(1) -3 >Emitted(4, 15) Source(5, 7) + SourceIndex(1) -4 >Emitted(4, 16) Source(5, 8) + SourceIndex(1) -5 >Emitted(4, 33) Source(5, 25) + SourceIndex(1) -6 >Emitted(4, 34) Source(5, 26) + SourceIndex(1) +1->Emitted(5, 1) Source(5, 1) + SourceIndex(1) +2 >Emitted(5, 9) Source(5, 1) + SourceIndex(1) +3 >Emitted(5, 15) Source(5, 7) + SourceIndex(1) +4 >Emitted(5, 16) Source(5, 8) + SourceIndex(1) +5 >Emitted(5, 33) Source(5, 25) + SourceIndex(1) +6 >Emitted(5, 34) Source(5, 26) + SourceIndex(1) --- >>>interface NoJsForHereEither { 1 > @@ -807,9 +808,9 @@ sourceFile:../../../first/first_PART1.ts > 2 >interface 3 > NoJsForHereEither -1 >Emitted(5, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(5, 11) Source(7, 11) + SourceIndex(1) -3 >Emitted(5, 28) Source(7, 28) + SourceIndex(1) +1 >Emitted(6, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(6, 11) Source(7, 11) + SourceIndex(1) +3 >Emitted(6, 28) Source(7, 28) + SourceIndex(1) --- >>> none: any; 1 >^^^^ @@ -823,18 +824,18 @@ sourceFile:../../../first/first_PART1.ts 3 > : 4 > any 5 > ; -1 >Emitted(6, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(6, 9) Source(8, 9) + SourceIndex(1) -3 >Emitted(6, 11) Source(8, 11) + SourceIndex(1) -4 >Emitted(6, 14) Source(8, 14) + SourceIndex(1) -5 >Emitted(6, 15) Source(8, 15) + SourceIndex(1) +1 >Emitted(7, 5) Source(8, 5) + SourceIndex(1) +2 >Emitted(7, 9) Source(8, 9) + SourceIndex(1) +3 >Emitted(7, 11) Source(8, 11) + SourceIndex(1) +4 >Emitted(7, 14) Source(8, 14) + SourceIndex(1) +5 >Emitted(7, 15) Source(8, 15) + SourceIndex(1) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(7, 2) Source(9, 2) + SourceIndex(1) +1 >Emitted(8, 2) Source(9, 2) + SourceIndex(1) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.d.ts @@ -852,17 +853,16 @@ sourceFile:../../../first/first_part3.ts 4 > () { > return "JS does hoists"; > } -1->Emitted(8, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(8, 18) Source(1, 10) + SourceIndex(2) -3 >Emitted(8, 19) Source(1, 11) + SourceIndex(2) -4 >Emitted(8, 30) Source(3, 2) + SourceIndex(2) +1->Emitted(9, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(9, 18) Source(1, 10) + SourceIndex(2) +3 >Emitted(9, 19) Source(1, 11) + SourceIndex(2) +4 >Emitted(9, 30) Source(3, 2) + SourceIndex(2) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.d.ts sourceFile:../../../second/second_part1.ts ------------------------------------------------------------------- >>>//# sourceMappingURL=first-output.d.ts.map ->>>#!someshebang second second_part1 >>>declare namespace N { 1-> 2 >^^^^^^^^^^^^^^^^^^ @@ -977,6 +977,7 @@ sourceFile:../../third_part1.ts >>>//# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.js] +#!someshebang second second_part1 var s = "Hello, world"; console.log(s); console.log(f()); @@ -984,7 +985,6 @@ function f() { return "JS does hoists"; } //# sourceMappingURL=first-output.js.map -#!someshebang second second_part1 var N; (function (N) { function f() { @@ -1006,7 +1006,7 @@ c.doSomething(); //# sourceMappingURL=third-output.js.map //// [/src/third/thirdjs/output/third-output.js.map] -{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":"ACIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;;;ACGD,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACXD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;;ALJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../third_part1.ts","../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts"],"names":[],"mappings":";ACIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;;ACGD,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACXD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;;ALJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} //// [/src/third/thirdjs/output/third-output.js.map.baseline.txt] =================================================================== @@ -1019,6 +1019,7 @@ sources: ../../third_part1.ts,../../../first/first_PART1.ts,../../../first/first emittedFile:/src/third/thirdjs/output/third-output.js sourceFile:../../../first/first_PART1.ts ------------------------------------------------------------------- +>>>#!someshebang second second_part1 >>>var s = "Hello, world"; 1 > 2 >^^^^ @@ -1036,12 +1037,12 @@ sourceFile:../../../first/first_PART1.ts 4 > = 5 > "Hello, world" 6 > ; -1 >Emitted(1, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(1, 5) Source(5, 7) + SourceIndex(1) -3 >Emitted(1, 6) Source(5, 8) + SourceIndex(1) -4 >Emitted(1, 9) Source(5, 11) + SourceIndex(1) -5 >Emitted(1, 23) Source(5, 25) + SourceIndex(1) -6 >Emitted(1, 24) Source(5, 26) + SourceIndex(1) +1 >Emitted(2, 1) Source(5, 1) + SourceIndex(1) +2 >Emitted(2, 5) Source(5, 7) + SourceIndex(1) +3 >Emitted(2, 6) Source(5, 8) + SourceIndex(1) +4 >Emitted(2, 9) Source(5, 11) + SourceIndex(1) +5 >Emitted(2, 23) Source(5, 25) + SourceIndex(1) +6 >Emitted(2, 24) Source(5, 26) + SourceIndex(1) --- >>>console.log(s); 1 > @@ -1067,14 +1068,14 @@ sourceFile:../../../first/first_PART1.ts 6 > s 7 > ) 8 > ; -1 >Emitted(2, 1) Source(11, 1) + SourceIndex(1) -2 >Emitted(2, 8) Source(11, 8) + SourceIndex(1) -3 >Emitted(2, 9) Source(11, 9) + SourceIndex(1) -4 >Emitted(2, 12) Source(11, 12) + SourceIndex(1) -5 >Emitted(2, 13) Source(11, 13) + SourceIndex(1) -6 >Emitted(2, 14) Source(11, 14) + SourceIndex(1) -7 >Emitted(2, 15) Source(11, 15) + SourceIndex(1) -8 >Emitted(2, 16) Source(11, 16) + SourceIndex(1) +1 >Emitted(3, 1) Source(11, 1) + SourceIndex(1) +2 >Emitted(3, 8) Source(11, 8) + SourceIndex(1) +3 >Emitted(3, 9) Source(11, 9) + SourceIndex(1) +4 >Emitted(3, 12) Source(11, 12) + SourceIndex(1) +5 >Emitted(3, 13) Source(11, 13) + SourceIndex(1) +6 >Emitted(3, 14) Source(11, 14) + SourceIndex(1) +7 >Emitted(3, 15) Source(11, 15) + SourceIndex(1) +8 >Emitted(3, 16) Source(11, 16) + SourceIndex(1) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js @@ -1099,15 +1100,15 @@ sourceFile:../../../first/first_part2.ts 7 > () 8 > ) 9 > ; -1->Emitted(3, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(3, 8) Source(1, 8) + SourceIndex(2) -3 >Emitted(3, 9) Source(1, 9) + SourceIndex(2) -4 >Emitted(3, 12) Source(1, 12) + SourceIndex(2) -5 >Emitted(3, 13) Source(1, 13) + SourceIndex(2) -6 >Emitted(3, 14) Source(1, 14) + SourceIndex(2) -7 >Emitted(3, 16) Source(1, 16) + SourceIndex(2) -8 >Emitted(3, 17) Source(1, 17) + SourceIndex(2) -9 >Emitted(3, 18) Source(1, 18) + SourceIndex(2) +1->Emitted(4, 1) Source(1, 1) + SourceIndex(2) +2 >Emitted(4, 8) Source(1, 8) + SourceIndex(2) +3 >Emitted(4, 9) Source(1, 9) + SourceIndex(2) +4 >Emitted(4, 12) Source(1, 12) + SourceIndex(2) +5 >Emitted(4, 13) Source(1, 13) + SourceIndex(2) +6 >Emitted(4, 14) Source(1, 14) + SourceIndex(2) +7 >Emitted(4, 16) Source(1, 16) + SourceIndex(2) +8 >Emitted(4, 17) Source(1, 17) + SourceIndex(2) +9 >Emitted(4, 18) Source(1, 18) + SourceIndex(2) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js @@ -1121,9 +1122,9 @@ sourceFile:../../../first/first_part3.ts 1 > 2 >function 3 > f -1 >Emitted(4, 1) Source(1, 1) + SourceIndex(3) -2 >Emitted(4, 10) Source(1, 10) + SourceIndex(3) -3 >Emitted(4, 11) Source(1, 11) + SourceIndex(3) +1 >Emitted(5, 1) Source(1, 1) + SourceIndex(3) +2 >Emitted(5, 10) Source(1, 10) + SourceIndex(3) +3 >Emitted(5, 11) Source(1, 11) + SourceIndex(3) --- >>> return "JS does hoists"; 1->^^^^ @@ -1135,10 +1136,10 @@ sourceFile:../../../first/first_part3.ts 2 > return 3 > "JS does hoists" 4 > ; -1->Emitted(5, 5) Source(2, 5) + SourceIndex(3) -2 >Emitted(5, 12) Source(2, 12) + SourceIndex(3) -3 >Emitted(5, 28) Source(2, 28) + SourceIndex(3) -4 >Emitted(5, 29) Source(2, 29) + SourceIndex(3) +1->Emitted(6, 5) Source(2, 5) + SourceIndex(3) +2 >Emitted(6, 12) Source(2, 12) + SourceIndex(3) +3 >Emitted(6, 28) Source(2, 28) + SourceIndex(3) +4 >Emitted(6, 29) Source(2, 29) + SourceIndex(3) --- >>>} 1 > @@ -1147,15 +1148,14 @@ sourceFile:../../../first/first_part3.ts 1 > > 2 >} -1 >Emitted(6, 1) Source(3, 1) + SourceIndex(3) -2 >Emitted(6, 2) Source(3, 2) + SourceIndex(3) +1 >Emitted(7, 1) Source(3, 1) + SourceIndex(3) +2 >Emitted(7, 2) Source(3, 2) + SourceIndex(3) --- ------------------------------------------------------------------- emittedFile:/src/third/thirdjs/output/third-output.js sourceFile:../../../second/second_part1.ts ------------------------------------------------------------------- >>>//# sourceMappingURL=first-output.js.map ->>>#!someshebang second second_part1 >>>var N; 1-> 2 >^^^^