MCPcopy Index your code
hub / github.com/BloombergGraphics/whatiscode / tolerateError

Function tolerateError

scripts/libs/esprima.js:2065–2083  ·  view source on GitHub ↗
(messageFormat)

Source from the content-addressed store, hash-verified

2063 }
2064
2065 function tolerateError(messageFormat) {
2066 var args, msg, error;
2067
2068 args = Array.prototype.slice.call(arguments, 1);
2069 /* istanbul ignore next */
2070 msg = messageFormat.replace(/%(\d)/g,
2071 function (whole, idx) {
2072 assert(idx < args.length, 'Message reference must be in range');
2073 return args[idx];
2074 }
2075 );
2076
2077 error = createError(lineNumber, lastIndex, msg);
2078 if (extra.errors) {
2079 recordError(error);
2080 } else {
2081 throw error;
2082 }
2083 }
2084
2085 // Throw an exception because of the token.
2086

Callers 10

checkProtoFunction · 0.85
parsePostfixExpressionFunction · 0.85
parseUnaryExpressionFunction · 0.85
parseVariableDeclarationFunction · 0.85
parseLexicalBindingFunction · 0.85
parseForStatementFunction · 0.85
parseReturnStatementFunction · 0.85
parseWithStatementFunction · 0.85
parseCatchClauseFunction · 0.85

Calls 3

assertFunction · 0.85
createErrorFunction · 0.85
recordErrorFunction · 0.85

Tested by

no test coverage detected