MCPcopy
hub / github.com/jquery/esprima / tolerateError

Method tolerateError

src/parser.ts:186–198  ·  view source on GitHub ↗
(messageFormat, ...values)

Source from the content-addressed store, hash-verified

184 }
185
186 tolerateError(messageFormat, ...values) {
187 const args = Array.prototype.slice.call(arguments, 1);
188 const msg = messageFormat.replace(/%(\d)/g, (whole, idx) => {
189 assert(idx < args.length, 'Message reference must be in range');
190 return args[idx];
191 }
192 );
193
194 const index = this.lastMarker.index;
195 const line = this.scanner.lineNumber;
196 const column = this.lastMarker.column + 1;
197 this.errorHandler.tolerateError(index, line, column, msg);
198 }
199
200 // Throw an exception because of the token.
201 unexpectedTokenError(token?: any, message?: string): Error {

Callers 15

parseObjectPropertyMethod · 0.95
parseUpdateExpressionMethod · 0.95
parseUnaryExpressionMethod · 0.95
parseLexicalBindingMethod · 0.95
parseIfClauseMethod · 0.95
parseForStatementMethod · 0.95
parseReturnStatementMethod · 0.95
parseWithStatementMethod · 0.95
parseCatchClauseMethod · 0.95
parseGetterMethodMethod · 0.95

Calls 1

assertFunction · 0.90

Tested by

no test coverage detected