Skip to content

Commit 7bcd18f

Browse files
Fix diagnostic codes.
1 parent 3a75350 commit 7bcd18f

6 files changed

+27
-27
lines changed

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ module ts {
344344
Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" },
345345
Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." },
346346
Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." },
347-
Type_0_is_not_an_array_type_or_a_string_type: { code: 2461, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." },
347+
Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." },
348+
The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." },
348349
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
349350
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
350351
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
@@ -491,6 +492,5 @@ module ts {
491492
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." },
492493
yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." },
493494
Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." },
494-
The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." },
495495
};
496496
}

src/compiler/diagnosticMessages.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,11 @@
13701370
},
13711371
"Type '{0}' is not an array type or a string type.": {
13721372
"category": "Error",
1373-
"code": 2461
1373+
"code": 2495
1374+
},
1375+
"The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": {
1376+
"category": "Error",
1377+
"code": 2496
13741378
},
13751379

13761380
"Import declaration '{0}' is using private name '{1}'.": {
@@ -1957,9 +1961,5 @@
19571961
"Generators are not currently supported.": {
19581962
"category": "Error",
19591963
"code": 9001
1960-
},
1961-
"The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": {
1962-
"category": "Error",
1963-
"code": 9002
19641964
}
19651965
}

tests/baselines/reference/ES5For-ofTypeCheck10.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2461: Type 'StringIterator' is not an array type or a string type.
1+
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
22
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(11,6): error TS2304: Cannot find name 'Symbol'.
33

44

55
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts (2 errors) ====
66
for (var v of new StringIterator) { }
77
~~~~~~~~~~~~~~~~~~
8-
!!! error TS2461: Type 'StringIterator' is not an array type or a string type.
8+
!!! error TS2495: Type 'StringIterator' is not an array type or a string type.
99

1010
// In ES3/5, you cannot for...of over an arbitrary iterable.
1111
class StringIterator {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2461: Type 'number' is not an array type or a string type.
1+
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type 'number' is not an array type or a string type.
22

33

44
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts (1 errors) ====
55
for (const v of 0) { }
66
~
7-
!!! error TS2461: Type 'number' is not an array type or a string type.
7+
!!! error TS2495: Type 'number' is not an array type or a string type.

tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
2-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
3-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
4-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
1+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
2+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
3+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
4+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
55

66

77
==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ====
88
var a = () => {
99
var arg = arguments[0]; // error
1010
~~~~~~~~~
11-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
11+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
1212
}
1313

1414
var b = function () {
1515
var a = () => {
1616
var arg = arguments[0]; // error
1717
~~~~~~~~~
18-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
18+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
1919
}
2020
}
2121

2222
function baz() {
2323
() => {
2424
var arg = arguments[0];
2525
~~~~~~~~~
26-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
26+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
2727
}
2828
}
2929

3030
function foo(inputFunc: () => void) { }
3131
foo(() => {
3232
var arg = arguments[0]; // error
3333
~~~~~~~~~
34-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
34+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
3535
});
3636

3737
function bar() {

tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
2-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
3-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
4-
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
1+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
2+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
3+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
4+
tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
55

66

77
==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ====
88
var a = () => {
99
var arg = arguments[0]; // error
1010
~~~~~~~~~
11-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
11+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
1212
}
1313

1414
var b = function () {
1515
var a = () => {
1616
var arg = arguments[0]; // error
1717
~~~~~~~~~
18-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
18+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
1919
}
2020
}
2121

2222
function baz() {
2323
() => {
2424
var arg = arguments[0];
2525
~~~~~~~~~
26-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
26+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
2727
}
2828
}
2929

3030
function foo(inputFunc: () => void) { }
3131
foo(() => {
3232
var arg = arguments[0]; // error
3333
~~~~~~~~~
34-
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
34+
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
3535
});
3636

3737
function bar() {

0 commit comments

Comments
 (0)