Skip to content

Commit 93db897

Browse files
committed
Fixed some of the baselines, made file comparisons handle different
casing, put diagnostic message in correct order
1 parent a12c35b commit 93db897

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module ts {
55
Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." },
66
Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." },
77
_0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." },
8-
Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." },
98
A_file_cannot_have_a_reference_to_itself: { code: 1006, category: DiagnosticCategory.Error, key: "A file cannot have a reference to itself." },
9+
Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." },
1010
Asterisk_Slash_expected: { code: 1010, category: DiagnosticCategory.Error, key: "'*/' expected." },
1111
Unexpected_token: { code: 1012, category: DiagnosticCategory.Error, key: "Unexpected token." },
1212
Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: DiagnosticCategory.Error, key: "Catch clause parameter cannot have a type annotation." },

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
"'{0}' expected.": {
1111
"category": "Error",
1212
"code": 1005
13-
},
14-
"Trailing comma not allowed.": {
15-
"category": "Error",
16-
"code": 1009
1713
},
1814
"A file cannot have a reference to itself.": {
1915
"category": "Error",
2016
"code": 1006
2117
},
18+
"Trailing comma not allowed.": {
19+
"category": "Error",
20+
"code": 1009
21+
},
2222
"'*/' expected.": {
2323
"category": "Error",
2424
"code": 1010

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@ module ts {
38333833
var referenceFilename = matchResult[3];
38343834
var basePath = getDirectoryPath(file.filename);
38353835
var referenceFullPath = normalizePath(combinePaths(basePath, referenceFilename));
3836-
if (file.filename === referenceFullPath) {
3836+
if (file.filename.toLocaleLowerCase() === referenceFullPath.toLocaleLowerCase()) {
38373837
errorAtPos(start, length, Diagnostics.A_file_cannot_have_a_reference_to_itself);
38383838
}
38393839
else {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
main.ts(1,1): error TS1006: A file cannot have a reference to itself.
12
main.ts(2,1): error TS6053: File 'nonExistingFile1.ts' not found.
23
main.ts(3,1): error TS6053: File 'nonExistingFile2.ts' not found.
34

45

5-
==== main.ts (2 errors) ====
6+
==== main.ts (3 errors) ====
67
/// <reference path="main.ts" />
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
!!! error TS1006: A file cannot have a reference to itself.
710
/// <reference path="nonExistingFile1.ts" />
811
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
912
!!! error TS6053: File 'nonExistingFile1.ts' not found.
1013
/// <reference path="nonExistingFile2.ts" />
1114
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12-
!!! error TS6053: File 'nonExistingFile2.ts' not found.
15+
!!! error TS6053: File 'nonExistingFile2.ts' not found.
16+
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
main.ts(1,1): error TS1006: A file cannot have a reference to itself.
12
main.ts(2,1): error TS6053: File 'nonExistingFile1.ts' not found.
23
main.ts(3,1): error TS6053: File 'nonExistingFile2.ts' not found.
34

45

5-
==== main.ts (2 errors) ====
6+
==== main.ts (3 errors) ====
67
/// <reference path="main.ts" />
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
!!! error TS1006: A file cannot have a reference to itself.
710
/// <reference path="nonExistingFile1.ts" />
811
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
912
!!! error TS6053: File 'nonExistingFile1.ts' not found.
1013
/// <reference path="nonExistingFile2.ts" />
1114
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12-
!!! error TS6053: File 'nonExistingFile2.ts' not found.
15+
!!! error TS6053: File 'nonExistingFile2.ts' not found.
16+

0 commit comments

Comments
 (0)