mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix #11480, disallow delete operator on readonly property or index
signature
This commit is contained in:
@@ -13550,6 +13550,9 @@ namespace ts {
|
||||
|
||||
function checkDeleteExpression(node: DeleteExpression): Type {
|
||||
checkExpression(node.expression);
|
||||
checkReferenceExpression(node.expression,
|
||||
Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference,
|
||||
Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property);
|
||||
return booleanType;
|
||||
}
|
||||
|
||||
|
||||
@@ -1983,6 +1983,14 @@
|
||||
"category": "Error",
|
||||
"code": 2697
|
||||
},
|
||||
"The operand of a delete operator must be a property reference": {
|
||||
"category": "Error",
|
||||
"code": 2698
|
||||
},
|
||||
"The operand of a delete operator cannot be a read-only property": {
|
||||
"category": "Error",
|
||||
"code": 2699
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
||||
Reference in New Issue
Block a user