fix #11480, disallow delete operator on readonly property or index

signature
This commit is contained in:
Herrington Darkholme
2016-11-02 20:27:53 +08:00
parent ab75ea75d3
commit 2e8bbf0c96
2 changed files with 11 additions and 0 deletions
+3
View File
@@ -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;
}
+8
View File
@@ -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",