Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,7 @@
"category": "Error",
"code": 5047
},
"Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.": {
"Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.": {
"category": "Error",
"code": 5051
},
Expand Down
19 changes: 7 additions & 12 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2043,27 +2043,22 @@ namespace ts {
}
}

if (options.inlineSources) {
if (!options.sourceMap && !options.inlineSourceMap) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided));
if (!options.sourceMap && !options.inlineSourceMap) {
if (options.inlineSources) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "inlineSources"));
}
if (options.sourceRoot) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources"));
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "sourceRoot"));
}
}

if (options.out && options.outFile) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile"));
}

if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) {
// Error to specify --mapRoot or --sourceRoot without mapSourceFiles
if (options.mapRoot) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap"));
}
if (options.sourceRoot && !options.inlineSourceMap) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap"));
}
if (options.mapRoot && !options.sourceMap) {
// Error to specify --mapRoot without --sourcemap
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap"));
}

if (options.declarationDir) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=== tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts ===

var a = 10;
>a : Symbol(a, Decl(optionsSourcemapInlineSourcesSourceRoot.ts, 1, 3))

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=== tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts ===

var a = 10;
>a : number
>10 : number

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'.
error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.


!!! error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
!!! error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'.
!!! error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.
==== m1.ts (0 errors) ====
var m1_a1 = 10;
class m1_c1 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'.
error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.


!!! error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
!!! error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'.
!!! error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.
==== m1.ts (0 errors) ====
var m1_a1 = 10;
class m1_c1 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.
error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.


!!! error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.
!!! error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
==== m1.ts (0 errors) ====
var m1_a1 = 10;
class m1_c1 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.
error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.


!!! error TS5052: Option 'sourceRoot' cannot be specified without specifying option 'sourceMap'.
!!! error TS5051: Option 'sourceRoot can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.
==== m1.ts (0 errors) ====
var m1_a1 = 10;
class m1_c1 {
Expand Down