MCPcopy Index your code
hub / github.com/nodejs/node / checkIfStatement

Function checkIfStatement

test/fixtures/snapshot/typescript.js:82680–82690  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

82678 checkExpression(node.expression);
82679 }
82680 function checkIfStatement(node) {
82681 // Grammar checking
82682 checkGrammarStatementInAmbientContext(node);
82683 checkTruthinessExpression(node.expression);
82684 checkTestingKnownTruthyCallableOrAwaitableType(node.expression, node.thenStatement);
82685 checkSourceElement(node.thenStatement);
82686 if (node.thenStatement.kind === 236 /* SyntaxKind.EmptyStatement */) {
82687 error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
82688 }
82689 checkSourceElement(node.elseStatement);
82690 }
82691 function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, body) {
82692 if (!strictNullChecks)
82693 return;

Callers 1

checkSourceElementWorkerFunction · 0.85

Tested by

no test coverage detected