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

Function checkWithStatement

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

Source from the content-addressed store, hash-verified

83677 }
83678 }
83679 function checkWithStatement(node) {
83680 // Grammar checking for withStatement
83681 if (!checkGrammarStatementInAmbientContext(node)) {
83682 if (node.flags & 32768 /* NodeFlags.AwaitContext */) {
83683 grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block);
83684 }
83685 }
83686 checkExpression(node.expression);
83687 var sourceFile = ts.getSourceFileOfNode(node);
83688 if (!hasParseDiagnostics(sourceFile)) {
83689 var start = ts.getSpanOfTokenAtPosition(sourceFile, node.pos).start;
83690 var end = node.statement.pos;
83691 grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);
83692 }
83693 }
83694 function checkSwitchStatement(node) {
83695 // Grammar checking
83696 checkGrammarStatementInAmbientContext(node);

Callers 1

checkSourceElementWorkerFunction · 0.85

Calls 5

grammarErrorOnFirstTokenFunction · 0.85
hasParseDiagnosticsFunction · 0.85
grammarErrorAtPosFunction · 0.85
checkExpressionFunction · 0.70

Tested by

no test coverage detected