From b2abab2f93758460941a4b0e1ec19c9e4d1f412b Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Fri, 25 Jul 2014 12:38:36 -0700 Subject: [PATCH 1/2] Improve the error in a 'for in' statement --- src/compiler/checker.ts | 4 ++-- src/compiler/diagnosticInformationMap.generated.ts | 4 ++-- src/compiler/diagnosticMessages.json | 4 ++-- .../reference/for-inStatementsInvalid.errors.txt | 8 ++++---- tests/baselines/reference/forIn.errors.txt | 2 +- tests/baselines/reference/forInStatement4.errors.txt | 2 +- tests/baselines/reference/forInStatement7.errors.txt | 2 +- tests/baselines/reference/noImplicitAnyForIn.errors.txt | 2 +- .../baselines/reference/parserForInStatement5.errors.txt | 2 +- .../baselines/reference/parserForInStatement7.errors.txt | 2 +- tests/baselines/reference/parserForStatement3.errors.txt | 2 +- tests/baselines/reference/parserForStatement4.errors.txt | 2 +- tests/baselines/reference/parserForStatement5.errors.txt | 2 +- tests/baselines/reference/parserForStatement6.errors.txt | 2 +- tests/baselines/reference/parserForStatement7.errors.txt | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9f1b0abaecf..8f4481b6bba 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5214,7 +5214,7 @@ module ts { if (node.declaration) { checkVariableDeclaration(node.declaration); if (node.declaration.type) { - error(node.declaration, Diagnostics.Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation); + error(node.declaration, Diagnostics.Left_hand_side_of_a_for_statement_cannot_use_a_type_annotation); } } @@ -5225,7 +5225,7 @@ module ts { if (node.variable) { var exprType = checkExpression(node.variable); if (exprType !== anyType && exprType !== stringType) { - error(node.variable, Diagnostics.Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any); + error(node.variable, Diagnostics.Left_hand_side_of_a_for_statement_must_be_of_type_string_or_any); } else { // run check only former check succeeded to avoid cascading errors diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index b243ef02d1d..cc48d2034af 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -114,8 +114,8 @@ module ts { The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: { code: 2115, category: DiagnosticCategory.Error, key: "Variable declarations of a 'for' statement cannot use a type annotation." }, - Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: { code: 2116, category: DiagnosticCategory.Error, key: "Variable declarations of a 'for' statement must be of types 'string' or 'any'." }, + Left_hand_side_of_a_for_statement_cannot_use_a_type_annotation: { code: 2115, category: DiagnosticCategory.Error, key: "Left hand side of a 'for' statement cannot use a type annotation." }, + Left_hand_side_of_a_for_statement_must_be_of_type_string_or_any: { code: 2116, category: DiagnosticCategory.Error, key: "Left hand side of a 'for' statement must be of type 'string' or 'any'." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c088fd4eddc..a0b4658316c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -448,11 +448,11 @@ "category": "Error", "code": 2114 }, - "Variable declarations of a 'for' statement cannot use a type annotation.": { + "Left hand side of a 'for' statement cannot use a type annotation.": { "category": "Error", "code": 2115 }, - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { + "Left hand side of a 'for' statement must be of type 'string' or 'any'.": { "category": "Error", "code": 2116 }, diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt index cd47a9297ca..1634414d5e2 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.errors.txt +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -2,21 +2,21 @@ var aNumber: number; for (aNumber in {}) { } ~~~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. var aBoolean: boolean; for (aBoolean in {}) { } ~~~~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. var aRegExp: RegExp; for (aRegExp in {}) { } ~~~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. for (var idx : number in {}) { } ~~~ -!!! Variable declarations of a 'for' statement cannot use a type annotation. +!!! Left hand side of a 'for' statement cannot use a type annotation. function fn(): void { } for (var x in fn()) { } diff --git a/tests/baselines/reference/forIn.errors.txt b/tests/baselines/reference/forIn.errors.txt index e6d33b50277..1133094a1c7 100644 --- a/tests/baselines/reference/forIn.errors.txt +++ b/tests/baselines/reference/forIn.errors.txt @@ -2,7 +2,7 @@ var arr = null; for (var i:number in arr) { // error ~ -!!! Variable declarations of a 'for' statement cannot use a type annotation. +!!! Left hand side of a 'for' statement cannot use a type annotation. var x1 = arr[i]; var y1 = arr[i]; } diff --git a/tests/baselines/reference/forInStatement4.errors.txt b/tests/baselines/reference/forInStatement4.errors.txt index 433fa89d535..abda9d4faf7 100644 --- a/tests/baselines/reference/forInStatement4.errors.txt +++ b/tests/baselines/reference/forInStatement4.errors.txt @@ -2,5 +2,5 @@ var expr: any; for (var a: number in expr) { ~ -!!! Variable declarations of a 'for' statement cannot use a type annotation. +!!! Left hand side of a 'for' statement cannot use a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement7.errors.txt b/tests/baselines/reference/forInStatement7.errors.txt index 8e75078d9e8..c9c753e1f2a 100644 --- a/tests/baselines/reference/forInStatement7.errors.txt +++ b/tests/baselines/reference/forInStatement7.errors.txt @@ -3,5 +3,5 @@ var expr: any; for (a in expr) { ~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForIn.errors.txt b/tests/baselines/reference/noImplicitAnyForIn.errors.txt index e06c7522cf8..3dea321743a 100644 --- a/tests/baselines/reference/noImplicitAnyForIn.errors.txt +++ b/tests/baselines/reference/noImplicitAnyForIn.errors.txt @@ -39,4 +39,4 @@ for (n[idx++] in m); ~~~~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. \ No newline at end of file +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement5.errors.txt b/tests/baselines/reference/parserForInStatement5.errors.txt index 6da9d681a55..76f0fc7d54c 100644 --- a/tests/baselines/reference/parserForInStatement5.errors.txt +++ b/tests/baselines/reference/parserForInStatement5.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement5.ts (2 errors) ==== for (var a: number in X) { ~ -!!! Variable declarations of a 'for' statement cannot use a type annotation. +!!! Left hand side of a 'for' statement cannot use a type annotation. ~ !!! Cannot find name 'X'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement7.errors.txt b/tests/baselines/reference/parserForInStatement7.errors.txt index f5b5451f8a8..fc769310bcc 100644 --- a/tests/baselines/reference/parserForInStatement7.errors.txt +++ b/tests/baselines/reference/parserForInStatement7.errors.txt @@ -3,7 +3,7 @@ ~ !!! Only a single variable declaration is allowed in a 'for...in' statement. ~ -!!! Variable declarations of a 'for' statement cannot use a type annotation. +!!! Left hand side of a 'for' statement cannot use a type annotation. ~ !!! Cannot find name 'X'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement3.errors.txt b/tests/baselines/reference/parserForStatement3.errors.txt index eab0e8e6805..24622bd44bf 100644 --- a/tests/baselines/reference/parserForStatement3.errors.txt +++ b/tests/baselines/reference/parserForStatement3.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement3.ts (7 errors) ==== for(d in _.jh[a]=_.jh[a]||[],b); ~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'd'. ~ diff --git a/tests/baselines/reference/parserForStatement4.errors.txt b/tests/baselines/reference/parserForStatement4.errors.txt index 69dc6388c63..592e6d82400 100644 --- a/tests/baselines/reference/parserForStatement4.errors.txt +++ b/tests/baselines/reference/parserForStatement4.errors.txt @@ -3,7 +3,7 @@ ~ !!! Cannot find name 'a'. ~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement5.errors.txt b/tests/baselines/reference/parserForStatement5.errors.txt index c3b2ee8d3b7..7f58172f8fc 100644 --- a/tests/baselines/reference/parserForStatement5.errors.txt +++ b/tests/baselines/reference/parserForStatement5.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement5.ts (2 errors) ==== for ({} in b) { ~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement6.errors.txt b/tests/baselines/reference/parserForStatement6.errors.txt index 433ce9c43c6..68dc8fece84 100644 --- a/tests/baselines/reference/parserForStatement6.errors.txt +++ b/tests/baselines/reference/parserForStatement6.errors.txt @@ -3,7 +3,7 @@ ~~~ !!! Cannot find name 'foo'. ~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement7.errors.txt b/tests/baselines/reference/parserForStatement7.errors.txt index 19580a0039b..ced68d47bca 100644 --- a/tests/baselines/reference/parserForStatement7.errors.txt +++ b/tests/baselines/reference/parserForStatement7.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement7.ts (3 errors) ==== for (new foo() in b) { ~~~~~~~~~ -!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. +!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. ~~~ !!! Cannot find name 'foo'. ~ From 936863c2993648b10f351fe4dabf9e10f7ebec7e Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Fri, 25 Jul 2014 14:01:50 -0700 Subject: [PATCH 2/2] Update error message to be more consistent with others --- src/compiler/checker.ts | 4 ++-- src/compiler/diagnosticInformationMap.generated.ts | 4 ++-- src/compiler/diagnosticMessages.json | 4 ++-- .../reference/for-inStatementsInvalid.errors.txt | 8 ++++---- tests/baselines/reference/forIn.errors.txt | 2 +- tests/baselines/reference/forInStatement4.errors.txt | 2 +- tests/baselines/reference/forInStatement7.errors.txt | 2 +- tests/baselines/reference/noImplicitAnyForIn.errors.txt | 2 +- .../baselines/reference/parserForInStatement5.errors.txt | 2 +- .../baselines/reference/parserForInStatement7.errors.txt | 2 +- tests/baselines/reference/parserForStatement3.errors.txt | 2 +- tests/baselines/reference/parserForStatement4.errors.txt | 2 +- tests/baselines/reference/parserForStatement5.errors.txt | 2 +- tests/baselines/reference/parserForStatement6.errors.txt | 2 +- tests/baselines/reference/parserForStatement7.errors.txt | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8f4481b6bba..8e0b40bf508 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5214,7 +5214,7 @@ module ts { if (node.declaration) { checkVariableDeclaration(node.declaration); if (node.declaration.type) { - error(node.declaration, Diagnostics.Left_hand_side_of_a_for_statement_cannot_use_a_type_annotation); + error(node.declaration, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); } } @@ -5225,7 +5225,7 @@ module ts { if (node.variable) { var exprType = checkExpression(node.variable); if (exprType !== anyType && exprType !== stringType) { - error(node.variable, Diagnostics.Left_hand_side_of_a_for_statement_must_be_of_type_string_or_any); + error(node.variable, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { // run check only former check succeeded to avoid cascading errors diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index cc48d2034af..c0c2347bb0a 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -114,8 +114,8 @@ module ts { The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - Left_hand_side_of_a_for_statement_cannot_use_a_type_annotation: { code: 2115, category: DiagnosticCategory.Error, key: "Left hand side of a 'for' statement cannot use a type annotation." }, - Left_hand_side_of_a_for_statement_must_be_of_type_string_or_any: { code: 2116, category: DiagnosticCategory.Error, key: "Left hand side of a 'for' statement must be of type 'string' or 'any'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2115, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2116, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a0b4658316c..51260ccd6ef 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -448,11 +448,11 @@ "category": "Error", "code": 2114 }, - "Left hand side of a 'for' statement cannot use a type annotation.": { + "The left-hand side of a 'for...in' statement cannot use a type annotation.": { "category": "Error", "code": 2115 }, - "Left hand side of a 'for' statement must be of type 'string' or 'any'.": { + "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { "category": "Error", "code": 2116 }, diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt index 1634414d5e2..4b4fff8c51c 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.errors.txt +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -2,21 +2,21 @@ var aNumber: number; for (aNumber in {}) { } ~~~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. var aBoolean: boolean; for (aBoolean in {}) { } ~~~~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. var aRegExp: RegExp; for (aRegExp in {}) { } ~~~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. for (var idx : number in {}) { } ~~~ -!!! Left hand side of a 'for' statement cannot use a type annotation. +!!! The left-hand side of a 'for...in' statement cannot use a type annotation. function fn(): void { } for (var x in fn()) { } diff --git a/tests/baselines/reference/forIn.errors.txt b/tests/baselines/reference/forIn.errors.txt index 1133094a1c7..51a3b220359 100644 --- a/tests/baselines/reference/forIn.errors.txt +++ b/tests/baselines/reference/forIn.errors.txt @@ -2,7 +2,7 @@ var arr = null; for (var i:number in arr) { // error ~ -!!! Left hand side of a 'for' statement cannot use a type annotation. +!!! The left-hand side of a 'for...in' statement cannot use a type annotation. var x1 = arr[i]; var y1 = arr[i]; } diff --git a/tests/baselines/reference/forInStatement4.errors.txt b/tests/baselines/reference/forInStatement4.errors.txt index abda9d4faf7..b228fb93c89 100644 --- a/tests/baselines/reference/forInStatement4.errors.txt +++ b/tests/baselines/reference/forInStatement4.errors.txt @@ -2,5 +2,5 @@ var expr: any; for (var a: number in expr) { ~ -!!! Left hand side of a 'for' statement cannot use a type annotation. +!!! The left-hand side of a 'for...in' statement cannot use a type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement7.errors.txt b/tests/baselines/reference/forInStatement7.errors.txt index c9c753e1f2a..432fe82237f 100644 --- a/tests/baselines/reference/forInStatement7.errors.txt +++ b/tests/baselines/reference/forInStatement7.errors.txt @@ -3,5 +3,5 @@ var expr: any; for (a in expr) { ~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForIn.errors.txt b/tests/baselines/reference/noImplicitAnyForIn.errors.txt index 3dea321743a..7e4122a8f26 100644 --- a/tests/baselines/reference/noImplicitAnyForIn.errors.txt +++ b/tests/baselines/reference/noImplicitAnyForIn.errors.txt @@ -39,4 +39,4 @@ for (n[idx++] in m); ~~~~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. \ No newline at end of file +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement5.errors.txt b/tests/baselines/reference/parserForInStatement5.errors.txt index 76f0fc7d54c..d9512576b7b 100644 --- a/tests/baselines/reference/parserForInStatement5.errors.txt +++ b/tests/baselines/reference/parserForInStatement5.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement5.ts (2 errors) ==== for (var a: number in X) { ~ -!!! Left hand side of a 'for' statement cannot use a type annotation. +!!! The left-hand side of a 'for...in' statement cannot use a type annotation. ~ !!! Cannot find name 'X'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement7.errors.txt b/tests/baselines/reference/parserForInStatement7.errors.txt index fc769310bcc..d1c039c751b 100644 --- a/tests/baselines/reference/parserForInStatement7.errors.txt +++ b/tests/baselines/reference/parserForInStatement7.errors.txt @@ -3,7 +3,7 @@ ~ !!! Only a single variable declaration is allowed in a 'for...in' statement. ~ -!!! Left hand side of a 'for' statement cannot use a type annotation. +!!! The left-hand side of a 'for...in' statement cannot use a type annotation. ~ !!! Cannot find name 'X'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement3.errors.txt b/tests/baselines/reference/parserForStatement3.errors.txt index 24622bd44bf..8af66924fc0 100644 --- a/tests/baselines/reference/parserForStatement3.errors.txt +++ b/tests/baselines/reference/parserForStatement3.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement3.ts (7 errors) ==== for(d in _.jh[a]=_.jh[a]||[],b); ~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'd'. ~ diff --git a/tests/baselines/reference/parserForStatement4.errors.txt b/tests/baselines/reference/parserForStatement4.errors.txt index 592e6d82400..923b05341b5 100644 --- a/tests/baselines/reference/parserForStatement4.errors.txt +++ b/tests/baselines/reference/parserForStatement4.errors.txt @@ -3,7 +3,7 @@ ~ !!! Cannot find name 'a'. ~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement5.errors.txt b/tests/baselines/reference/parserForStatement5.errors.txt index 7f58172f8fc..e1d52c58ab6 100644 --- a/tests/baselines/reference/parserForStatement5.errors.txt +++ b/tests/baselines/reference/parserForStatement5.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement5.ts (2 errors) ==== for ({} in b) { ~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement6.errors.txt b/tests/baselines/reference/parserForStatement6.errors.txt index 68dc8fece84..cb758f34359 100644 --- a/tests/baselines/reference/parserForStatement6.errors.txt +++ b/tests/baselines/reference/parserForStatement6.errors.txt @@ -3,7 +3,7 @@ ~~~ !!! Cannot find name 'foo'. ~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. ~ !!! Cannot find name 'b'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement7.errors.txt b/tests/baselines/reference/parserForStatement7.errors.txt index ced68d47bca..0b1eeba1e05 100644 --- a/tests/baselines/reference/parserForStatement7.errors.txt +++ b/tests/baselines/reference/parserForStatement7.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement7.ts (3 errors) ==== for (new foo() in b) { ~~~~~~~~~ -!!! Left hand side of a 'for' statement must be of type 'string' or 'any'. +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. ~~~ !!! Cannot find name 'foo'. ~