addressed PR feedback

This commit is contained in:
Vladimir Matveev 2015-10-09 09:55:25 -07:00
parent a975895e4d
commit a556209b7e
4 changed files with 6 additions and 6 deletions

View File

@ -15477,7 +15477,7 @@ namespace ts {
if (prop.kind === SyntaxKind.ShorthandPropertyAssignment && !inDestructuring && (<ShorthandPropertyAssignment>prop).objectAssignmentInitializer) {
// having objectAssignmentInitializer is only valid in ObjectAssignmentPattern
// outside of destructuring it is a syntax error
return grammarErrorOnNode((<ShorthandPropertyAssignment>prop).equalsToken, Diagnostics.can_only_be_used_in_object_literal_properties_inside_destructuring_assignment);
return grammarErrorOnNode((<ShorthandPropertyAssignment>prop).equalsToken, Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
}
// ECMA-262 11.1.5 Object Initialiser

View File

@ -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
},

View File

@ -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 }}) {

View File

@ -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 }}) {