mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Add warning message empty THEN clause
This commit is contained in:
@@ -12227,6 +12227,11 @@ namespace ts {
|
||||
|
||||
checkExpression(node.expression);
|
||||
checkSourceElement(node.thenStatement);
|
||||
|
||||
if (node.thenStatement.kind === SyntaxKind.EmptyStatement) {
|
||||
error(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
|
||||
}
|
||||
|
||||
checkSourceElement(node.elseStatement);
|
||||
}
|
||||
|
||||
|
||||
@@ -799,7 +799,11 @@
|
||||
"'=' can only be used in an object literal property inside a destructuring assignment.": {
|
||||
"category": "Error",
|
||||
"code": 1312
|
||||
},
|
||||
},
|
||||
"The body of an 'if' statement cannot be the empty statement.": {
|
||||
"category": "Error",
|
||||
"code": 1313
|
||||
},
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
|
||||
Reference in New Issue
Block a user