Skip to content

Commit a556209

Browse files
committed
addressed PR feedback
1 parent a975895 commit a556209

4 files changed

+6
-6
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15477,7 +15477,7 @@ namespace ts {
1547715477
if (prop.kind === SyntaxKind.ShorthandPropertyAssignment && !inDestructuring && (<ShorthandPropertyAssignment>prop).objectAssignmentInitializer) {
1547815478
// having objectAssignmentInitializer is only valid in ObjectAssignmentPattern
1547915479
// outside of destructuring it is a syntax error
15480-
return grammarErrorOnNode((<ShorthandPropertyAssignment>prop).equalsToken, Diagnostics.can_only_be_used_in_object_literal_properties_inside_destructuring_assignment);
15480+
return grammarErrorOnNode((<ShorthandPropertyAssignment>prop).equalsToken, Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
1548115481
}
1548215482

1548315483
// ECMA-262 11.1.5 Object Initialiser

src/compiler/diagnosticMessages.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@
800800
"category": "Error",
801801
"code": 1311
802802
},
803-
"'=' can only be used in object literal properties inside destructuring assignment.": {
803+
"'=' can only be used in an object literal property inside a destructuring assignment.": {
804804
"category": "Error",
805805
"code": 1312
806806
},

tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,19): erro
1313
Types of property 'x' are incompatible.
1414
Type 'number' is not assignable to type 'string'.
1515
tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,12): error TS2304: Cannot find name 's'.
16-
tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): error TS1312: '=' can only be used in object literal properties inside destructuring assignment.
16+
tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment.
1717

1818

1919
==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (12 errors) ====
@@ -157,7 +157,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err
157157
~
158158
!!! error TS2304: Cannot find name 's'.
159159
~
160-
!!! error TS1312: '=' can only be used in object literal properties inside destructuring assignment.
160+
!!! error TS1312: '=' can only be used in an object literal property inside a destructuring assignment.
161161
});
162162

163163
function foo({a = 4, b = { x: 5 }}) {

tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,19):
1313
Types of property 'x' are incompatible.
1414
Type 'number' is not assignable to type 'string'.
1515
tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,12): error TS2304: Cannot find name 's'.
16-
tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): error TS1312: '=' can only be used in object literal properties inside destructuring assignment.
16+
tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment.
1717

1818

1919
==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (12 errors) ====
@@ -157,7 +157,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14):
157157
~
158158
!!! error TS2304: Cannot find name 's'.
159159
~
160-
!!! error TS1312: '=' can only be used in object literal properties inside destructuring assignment.
160+
!!! error TS1312: '=' can only be used in an object literal property inside a destructuring assignment.
161161
});
162162

163163
function foo({a = 4, b = { x: 5 }}) {

0 commit comments

Comments
 (0)