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
4 changes: 2 additions & 2 deletions src/compiler/diagnosticInformationMap.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ module ts {
Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" },
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}'." },
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." },
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." },
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." },
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." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
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}'." },
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}'." },
Expand Down Expand Up @@ -491,6 +492,5 @@ module ts {
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." },
yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." },
Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." },
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." },
};
}
10 changes: 5 additions & 5 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,11 @@
},
"Type '{0}' is not an array type or a string type.": {
"category": "Error",
"code": 2461
"code": 2495
},
"The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": {
"category": "Error",
"code": 2496
},

"Import declaration '{0}' is using private name '{1}'.": {
Expand Down Expand Up @@ -1957,9 +1961,5 @@
"Generators are not currently supported.": {
"category": "Error",
"code": 9001
},
"The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": {
"category": "Error",
"code": 9002
}
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/ES5For-ofTypeCheck10.errors.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2461: Type 'StringIterator' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(11,6): error TS2304: Cannot find name 'Symbol'.


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

// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2461: Type 'number' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type 'number' is not an array type or a string type.


==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts (1 errors) ====
for (const v of 0) { }
~
!!! error TS2461: Type 'number' is not an array type or a string type.
!!! error TS2495: Type 'number' is not an array type or a string type.
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
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.
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.
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.
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.
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.
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.
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.
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.


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

var b = function () {
var a = () => {
var arg = arguments[0]; // error
~~~~~~~~~
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
}
}

function baz() {
() => {
var arg = arguments[0];
~~~~~~~~~
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
}
}

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

function bar() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
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.
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.
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.
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.
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.
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.
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.
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.


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

var b = function () {
var a = () => {
var arg = arguments[0]; // error
~~~~~~~~~
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
}
}

function baz() {
() => {
var arg = arguments[0];
~~~~~~~~~
!!! error TS9002: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.
}
}

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

function bar() {
Expand Down