MCPcopy
hub / github.com/BloombergGraphics/whatiscode / tolerateUnexpectedToken

Function tolerateUnexpectedToken

scripts/libs/esprima.js:2117–2124  ·  view source on GitHub ↗
(token, message)

Source from the content-addressed store, hash-verified

2115 }
2116
2117 function tolerateUnexpectedToken(token, message) {
2118 var error = unexpectedTokenError(token, message);
2119 if (extra.errors) {
2120 recordError(error);
2121 } else {
2122 throw error;
2123 }
2124 }
2125
2126 // Expect the next token to match the specified punctuator.
2127 // If not, an exception will be thrown.

Callers 14

skipMultiLineCommentFunction · 0.85
scanRegExpFlagsFunction · 0.85
expectCommaSeparatorFunction · 0.85
parsePropertyFunctionFunction · 0.85
parseObjectPropertyKeyFunction · 0.85
tryParseMethodDefinitionFunction · 0.85
parsePrimaryExpressionFunction · 0.85
parseVariableIdentifierFunction · 0.85
parseFunctionDeclarationFunction · 0.85

Calls 2

unexpectedTokenErrorFunction · 0.85
recordErrorFunction · 0.85

Tested by

no test coverage detected