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

Function recordError

scripts/libs/esprima.js:2025–2038  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

2023
2024
2025 function recordError(error) {
2026 var e, existing;
2027
2028 for (e = 0; e < extra.errors.length; e++) {
2029 existing = extra.errors[e];
2030 // Prevent duplicated error.
2031 /* istanbul ignore next */
2032 if (existing.index === error.index && existing.message === error.message) {
2033 return;
2034 }
2035 }
2036
2037 extra.errors.push(error);
2038 }
2039
2040 function createError(line, pos, description) {
2041 var error = new Error('Line ' + line + ': ' + description);

Callers 3

tolerateErrorFunction · 0.85
tolerateUnexpectedTokenFunction · 0.85
tokenizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected