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

Method throwError

src/parser.ts:172–184  ·  view source on GitHub ↗
(messageFormat: string, ...values)

Source from the content-addressed store, hash-verified

170 }
171
172 throwError(messageFormat: string, ...values): void {
173 const args = Array.prototype.slice.call(arguments, 1);
174 const msg = messageFormat.replace(/%(\d)/g, (whole, idx) => {
175 assert(idx < args.length, 'Message reference must be in range');
176 return args[idx];
177 }
178 );
179
180 const index = this.lastMarker.index;
181 const line = this.lastMarker.line;
182 const column = this.lastMarker.column + 1;
183 throw this.errorHandler.createError(index, line, column, msg);
184 }
185
186 tolerateError(messageFormat, ...values) {
187 const args = Array.prototype.slice.call(arguments, 1);

Callers 14

parseLexicalBindingMethod · 0.95
parseBreakStatementMethod · 0.95
parseSwitchStatementMethod · 0.95
parseThrowStatementMethod · 0.95
parseTryStatementMethod · 0.95
parseRestElementMethod · 0.95
parseModuleSpecifierMethod · 0.95

Calls 2

assertFunction · 0.90
createErrorMethod · 0.80

Tested by

no test coverage detected