Add warning message empty THEN clause

This commit is contained in:
Martin Všetička
2015-10-23 08:36:36 +02:00
parent 3ad29eafe3
commit 1e2108854b
9 changed files with 107 additions and 1 deletions

View File

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

View File

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