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

Function parseThrowStatement

test/fixtures/snapshot/typescript.js:36024–36044  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36022 return withJSDoc(finishNode(factory.createSwitchStatement(expression, caseBlock), pos), hasJSDoc);
36023 }
36024 function parseThrowStatement() {
36025 // ThrowStatement[Yield] :
36026 // throw [no LineTerminator here]Expression[In, ?Yield];
36027 var pos = getNodePos();
36028 var hasJSDoc = hasPrecedingJSDocComment();
36029 parseExpected(109 /* SyntaxKind.ThrowKeyword */);
36030 // Because of automatic semicolon insertion, we need to report error if this
36031 // throw could be terminated with a semicolon. Note: we can't call 'parseExpression'
36032 // directly as that might consume an expression on the following line.
36033 // Instead, we create a "missing" identifier, but don't report an error. The actual error
36034 // will be reported in the grammar walker.
36035 var expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
36036 if (expression === undefined) {
36037 identifierCount++;
36038 expression = finishNode(factory.createIdentifier(""), getNodePos());
36039 }
36040 if (!tryParseSemicolon()) {
36041 parseErrorForMissingSemicolonAfter(expression);
36042 }
36043 return withJSDoc(finishNode(factory.createThrowStatement(expression), pos), hasJSDoc);
36044 }
36045 // TODO: Review for error recovery
36046 function parseTryStatement() {
36047 var pos = getNodePos();

Callers 1

parseStatementFunction · 0.85

Calls 8

getNodePosFunction · 0.85
hasPrecedingJSDocCommentFunction · 0.85
parseExpectedFunction · 0.85
allowInAndFunction · 0.85
finishNodeFunction · 0.85
tryParseSemicolonFunction · 0.85
withJSDocFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…