Skip to content

Commit 658bba9

Browse files
committed
Add --inlineSources option
1 parent c940b16 commit 658bba9

22 files changed

+366
-23
lines changed

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ module ts {
3434
name: "inlineSourceMap",
3535
type: "boolean",
3636
},
37+
{
38+
name: "inlineSources",
39+
type: "boolean",
40+
},
3741
{
3842
name: "listFiles",
3943
type: "boolean",

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ module ts {
455455
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
456456
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
457457
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
458-
Option_out_cannot_be_specified_with_option_inlineSourceMap: { code: 5051, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'inlineSourceMap'." },
458+
Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." },
459459
Concatenate_and_emit_output_to_single_file: { code: 6001, category: DiagnosticCategory.Message, key: "Concatenate and emit output to single file." },
460460
Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." },
461461
Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." },

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@
18081808
"category": "Error",
18091809
"code": 5050
18101810
},
1811-
"Option 'out' cannot be specified with option 'inlineSourceMap'.": {
1811+
"Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.": {
18121812
"category": "Error",
18131813
"code": 5051
18141814
},

src/compiler/emitter.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@ var __param = this.__param || function(index, decorator) { return function (targ
493493

494494
// The one that can be used from program to get the actual source file
495495
sourceMapData.inputSourceFileNames.push(node.fileName);
496+
497+
if (compilerOptions.inlineSources) {
498+
if (!sourceMapData.sourceMapSourcesContent) {
499+
sourceMapData.sourceMapSourcesContent = [];
500+
}
501+
sourceMapData.sourceMapSourcesContent.push(node.text);
502+
}
496503
}
497504

498505
function recordScopeNameOfNode(node: Node, scopeName?: string) {
@@ -599,15 +606,14 @@ var __param = this.__param || function(index, decorator) { return function (targ
599606
function writeJavaScriptAndSourceMapFile(emitOutput: string, writeByteOrderMark: boolean) {
600607
encodeLastRecordedSourceMapSpan();
601608

602-
let fileContents = compilerOptions.inlineSourceMap ? [currentSourceFile.text] : undefined;
603609
let sourceMapText = serializeSourceMapContents(
604610
3,
605611
sourceMapData.sourceMapFile,
606612
sourceMapData.sourceMapSourceRoot,
607613
sourceMapData.sourceMapSources,
608614
sourceMapData.sourceMapNames,
609615
sourceMapData.sourceMapMappings,
610-
fileContents);
616+
sourceMapData.sourceMapSourcesContent);
611617

612618
sourceMapDataList.push(sourceMapData);
613619

@@ -638,6 +644,7 @@ var __param = this.__param || function(index, decorator) { return function (targ
638644
inputSourceFileNames: [],
639645
sourceMapNames: [],
640646
sourceMapMappings: "",
647+
sourceMapSourcesContent: undefined,
641648
sourceMapDecodedMappings: []
642649
};
643650

src/compiler/program.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,12 @@ module ts {
484484
if (options.sourceRoot) {
485485
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap));
486486
}
487-
if (options.out) {
488-
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_out_cannot_be_specified_with_option_inlineSourceMap));
487+
}
488+
489+
490+
if (options.inlineSources) {
491+
if (!options.sourceMap && !options.inlineSourceMap) {
492+
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided));
489493
}
490494
}
491495

src/compiler/types.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,14 +1092,15 @@ module ts {
10921092
}
10931093

10941094
export interface SourceMapData {
1095-
sourceMapFilePath: string; // Where the sourcemap file is written
1096-
jsSourceMappingURL: string; // source map URL written in the .js file
1097-
sourceMapFile: string; // Source map's file field - .js file name
1098-
sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not ""
1099-
sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map
1100-
inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list
1101-
sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map
1102-
sourceMapMappings: string; // Source map's mapping field - encoded source map spans
1095+
sourceMapFilePath: string; // Where the sourcemap file is written
1096+
jsSourceMappingURL: string; // source map URL written in the .js file
1097+
sourceMapFile: string; // Source map's file field - .js file name
1098+
sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not ""
1099+
sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map
1100+
sourceMapSourcesContent?: string[]; // Source map's sourcesContent field - list of the sources' text to be embedded in the source map
1101+
inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list
1102+
sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map
1103+
sourceMapMappings: string; // Source map's mapping field - encoded source map spans
11031104
sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings
11041105
}
11051106

@@ -1640,6 +1641,7 @@ module ts {
16401641
emitBOM?: boolean;
16411642
help?: boolean;
16421643
inlineSourceMap?: boolean;
1644+
inlineSources?: boolean;
16431645
listFiles?: boolean;
16441646
locale?: string;
16451647
mapRoot?: string;

src/harness/harness.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,10 @@ module Harness {
10761076
case 'inlinesourcemap':
10771077
options.inlineSourceMap = setting.value === 'true';
10781078
break;
1079+
1080+
case 'inlinesources':
1081+
options.inlineSources = setting.value === 'true';
1082+
break;
10791083

10801084
default:
10811085
throw new Error('Unsupported compiler setting ' + setting.flag);
@@ -1473,7 +1477,8 @@ module Harness {
14731477
"noimplicitany", "noresolve", "newline", "newlines", "emitbom",
14741478
"errortruncation", "usecasesensitivefilenames", "preserveconstenums",
14751479
"includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal",
1476-
"separatecompilation", "inlinesourcemap", "maproot", "sourceroot"];
1480+
"separatecompilation", "inlinesourcemap", "maproot", "sourceroot",
1481+
"inlinesources"];
14771482

14781483
function extractCompilerSettings(content: string): CompilerSetting[] {
14791484

src/harness/sourceMapRecorder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ module Harness.SourceMapRecoder {
237237
sourceMapRecoder.WriteLine("mapUrl: " + sourceMapData.jsSourceMappingURL);
238238
sourceMapRecoder.WriteLine("sourceRoot: " + sourceMapData.sourceMapSourceRoot);
239239
sourceMapRecoder.WriteLine("sources: " + sourceMapData.sourceMapSources);
240+
if (sourceMapData.sourceMapSourcesContent) {
241+
sourceMapRecoder.WriteLine("sourcesContent: " + JSON.stringify(sourceMapData.sourceMapSourcesContent));
242+
}
240243
sourceMapRecoder.WriteLine("===================================================================");
241244
}
242245

tests/baselines/reference/inlineSourceMap.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/inlineSourceMap.sourcemap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ sourceFile:inlineSourceMap.ts
3939
6 > ^
4040
7 > ^
4141
8 > ^
42-
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
42+
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
4343
1->
4444
>
4545
2 >console
@@ -58,4 +58,4 @@ sourceFile:inlineSourceMap.ts
5858
7 >Emitted(2, 15) Source(3, 15) + SourceIndex(0)
5959
8 >Emitted(2, 16) Source(3, 16) + SourceIndex(0)
6060
---
61-
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lU291cmNlTWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW5saW5lU291cmNlTWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbnZhciB4ID0gMDtcbmNvbnNvbGUubG9nKHgpOyJdfQ==
61+
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lU291cmNlTWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW5saW5lU291cmNlTWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ==

tests/baselines/reference/inlineSourceMap2.errors.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
error TS5051: Option 'out' cannot be specified with option 'inlineSourceMap'.
21
error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
32
error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
43
error TS5048: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
54
tests/cases/compiler/inlineSourceMap2.ts(5,1): error TS2304: Cannot find name 'console'.
65

76

8-
!!! error TS5051: Option 'out' cannot be specified with option 'inlineSourceMap'.
97
!!! error TS5050: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
108
!!! error TS5049: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
119
!!! error TS5048: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.

tests/baselines/reference/inlineSourceMap2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/inlineSourceMap2.sourcemap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ sourceFile:inlineSourceMap2.ts
4949
6 > ^
5050
7 > ^
5151
8 > ^
52-
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
52+
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
5353
1->
5454
>
5555
2 >console
@@ -68,4 +68,4 @@ sourceFile:inlineSourceMap2.ts
6868
7 >Emitted(3, 15) Source(5, 15) + SourceIndex(0)
6969
8 >Emitted(3, 16) Source(5, 16) + SourceIndex(0)
7070
---
71-
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0ZmlsZS5qcyIsInNvdXJjZVJvb3QiOiJmaWxlOi8vL2ZvbGRlci8iLCJzb3VyY2VzIjpbImlubGluZVNvdXJjZU1hcDIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsdUJBQXVCO0FBRXZCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJcbi8vIGNvbmZpZ3VyYXRpb24gZXJyb3JzXG5cbnZhciB4ID0gMDtcbmNvbnNvbGUubG9nKHgpOyJdfQ==
71+
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0ZmlsZS5qcyIsInNvdXJjZVJvb3QiOiJmaWxlOi8vL2ZvbGRlci8iLCJzb3VyY2VzIjpbImlubGluZVNvdXJjZU1hcDIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsdUJBQXVCO0FBRXZCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMifQ==
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests/cases/compiler/a.ts(3,1): error TS2304: Cannot find name 'console'.
2+
tests/cases/compiler/b.ts(2,1): error TS2304: Cannot find name 'console'.
3+
4+
5+
==== tests/cases/compiler/a.ts (1 errors) ====
6+
7+
var a = 0;
8+
console.log(a);
9+
~~~~~~~
10+
!!! error TS2304: Cannot find name 'console'.
11+
12+
==== tests/cases/compiler/b.ts (1 errors) ====
13+
var b = 0;
14+
console.log(b);
15+
~~~~~~~
16+
!!! error TS2304: Cannot find name 'console'.

tests/baselines/reference/inlineSources.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/inlineSources.js.map

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
===================================================================
2+
JsFile: out.js
3+
mapUrl: out.js.map
4+
sourceRoot:
5+
sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts
6+
sourcesContent: ["\nvar a = 0;\nconsole.log(a);\n","var b = 0;\nconsole.log(b);"]
7+
===================================================================
8+
-------------------------------------------------------------------
9+
emittedFile:out.js
10+
sourceFile:tests/cases/compiler/a.ts
11+
-------------------------------------------------------------------
12+
>>>var a = 0;
13+
1 >
14+
2 >^^^^
15+
3 > ^
16+
4 > ^^^
17+
5 > ^
18+
6 > ^
19+
7 > ^^^^^^->
20+
1 >
21+
>
22+
2 >var
23+
3 > a
24+
4 > =
25+
5 > 0
26+
6 > ;
27+
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
28+
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
29+
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
30+
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
31+
5 >Emitted(1, 10) Source(2, 10) + SourceIndex(0)
32+
6 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
33+
---
34+
>>>console.log(a);
35+
1->
36+
2 >^^^^^^^
37+
3 > ^
38+
4 > ^^^
39+
5 > ^
40+
6 > ^
41+
7 > ^
42+
8 > ^
43+
1->
44+
>
45+
2 >console
46+
3 > .
47+
4 > log
48+
5 > (
49+
6 > a
50+
7 > )
51+
8 > ;
52+
1->Emitted(2, 1) Source(3, 1) + SourceIndex(0)
53+
2 >Emitted(2, 8) Source(3, 8) + SourceIndex(0)
54+
3 >Emitted(2, 9) Source(3, 9) + SourceIndex(0)
55+
4 >Emitted(2, 12) Source(3, 12) + SourceIndex(0)
56+
5 >Emitted(2, 13) Source(3, 13) + SourceIndex(0)
57+
6 >Emitted(2, 14) Source(3, 14) + SourceIndex(0)
58+
7 >Emitted(2, 15) Source(3, 15) + SourceIndex(0)
59+
8 >Emitted(2, 16) Source(3, 16) + SourceIndex(0)
60+
---
61+
-------------------------------------------------------------------
62+
emittedFile:out.js
63+
sourceFile:tests/cases/compiler/b.ts
64+
-------------------------------------------------------------------
65+
>>>var b = 0;
66+
1 >
67+
2 >^^^^
68+
3 > ^
69+
4 > ^^^
70+
5 > ^
71+
6 > ^
72+
7 > ^^^^^^->
73+
1 >
74+
2 >var
75+
3 > b
76+
4 > =
77+
5 > 0
78+
6 > ;
79+
1 >Emitted(3, 1) Source(1, 1) + SourceIndex(1)
80+
2 >Emitted(3, 5) Source(1, 5) + SourceIndex(1)
81+
3 >Emitted(3, 6) Source(1, 6) + SourceIndex(1)
82+
4 >Emitted(3, 9) Source(1, 9) + SourceIndex(1)
83+
5 >Emitted(3, 10) Source(1, 10) + SourceIndex(1)
84+
6 >Emitted(3, 11) Source(1, 11) + SourceIndex(1)
85+
---
86+
>>>console.log(b);
87+
1->
88+
2 >^^^^^^^
89+
3 > ^
90+
4 > ^^^
91+
5 > ^
92+
6 > ^
93+
7 > ^
94+
8 > ^
95+
9 > ^^^^^^^^^^^^^^^->
96+
1->
97+
>
98+
2 >console
99+
3 > .
100+
4 > log
101+
5 > (
102+
6 > b
103+
7 > )
104+
8 > ;
105+
1->Emitted(4, 1) Source(2, 1) + SourceIndex(1)
106+
2 >Emitted(4, 8) Source(2, 8) + SourceIndex(1)
107+
3 >Emitted(4, 9) Source(2, 9) + SourceIndex(1)
108+
4 >Emitted(4, 12) Source(2, 12) + SourceIndex(1)
109+
5 >Emitted(4, 13) Source(2, 13) + SourceIndex(1)
110+
6 >Emitted(4, 14) Source(2, 14) + SourceIndex(1)
111+
7 >Emitted(4, 15) Source(2, 15) + SourceIndex(1)
112+
8 >Emitted(4, 16) Source(2, 16) + SourceIndex(1)
113+
---
114+
>>>//# sourceMappingURL=out.js.map
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests/cases/compiler/a.ts(3,1): error TS2304: Cannot find name 'console'.
2+
tests/cases/compiler/b.ts(2,1): error TS2304: Cannot find name 'console'.
3+
4+
5+
==== tests/cases/compiler/a.ts (1 errors) ====
6+
7+
var a = 0;
8+
console.log(a);
9+
~~~~~~~
10+
!!! error TS2304: Cannot find name 'console'.
11+
12+
==== tests/cases/compiler/b.ts (1 errors) ====
13+
var b = 0;
14+
console.log(b);
15+
~~~~~~~
16+
!!! error TS2304: Cannot find name 'console'.

0 commit comments

Comments
 (0)