diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ece6860e5b2..2ede84062ce 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15477,7 +15477,7 @@ namespace ts { if (prop.kind === SyntaxKind.ShorthandPropertyAssignment && !inDestructuring && (prop).objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error - return grammarErrorOnNode((prop).equalsToken, Diagnostics.can_only_be_used_in_object_literal_properties_inside_destructuring_assignment); + return grammarErrorOnNode((prop).equalsToken, Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } // ECMA-262 11.1.5 Object Initialiser diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a41d5d99005..ae54fda8496 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -800,7 +800,7 @@ "category": "Error", "code": 1311 }, - "'=' can only be used in object literal properties inside destructuring assignment.": { + "'=' can only be used in an object literal property inside a destructuring assignment.": { "category": "Error", "code": 1312 }, diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt index 844078cd8f1..7ac5fe9a26c 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt @@ -13,7 +13,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,19): erro Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,12): error TS2304: Cannot find name 's'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): error TS1312: '=' can only be used in object literal properties inside destructuring assignment. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. ==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (12 errors) ==== @@ -157,7 +157,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err ~ !!! error TS2304: Cannot find name 's'. ~ -!!! error TS1312: '=' can only be used in object literal properties inside destructuring assignment. +!!! error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. }); function foo({a = 4, b = { x: 5 }}) { diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt index 208a8798c39..7e6b6b35d7f 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt @@ -13,7 +13,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,19): Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,12): error TS2304: Cannot find name 's'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): error TS1312: '=' can only be used in object literal properties inside destructuring assignment. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. ==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (12 errors) ==== @@ -157,7 +157,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): ~ !!! error TS2304: Cannot find name 's'. ~ -!!! error TS1312: '=' can only be used in object literal properties inside destructuring assignment. +!!! error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. }); function foo({a = 4, b = { x: 5 }}) {