MCPcopy Index your code
hub / github.com/dchester/jsonpath / throwError

Function throwError

jsonpath.js:1837–1862  ·  view source on GitHub ↗
(token, messageFormat)

Source from the content-addressed store, hash-verified

1835 // Throw an exception
1836
1837 function throwError(token, messageFormat) {
1838 var error,
1839 args = Array.prototype.slice.call(arguments, 2),
1840 msg = messageFormat.replace(
1841 /%(\d)/g,
1842 function (whole, index) {
1843 assert(index < args.length, 'Message reference must be in range');
1844 return args[index];
1845 }
1846 );
1847
1848 if (typeof token.lineNumber === 'number') {
1849 error = new Error('Line ' + token.lineNumber + ': ' + msg);
1850 error.index = token.start;
1851 error.lineNumber = token.lineNumber;
1852 error.column = token.start - lineStart + 1;
1853 } else {
1854 error = new Error('Line ' + lineNumber + ': ' + msg);
1855 error.index = index;
1856 error.lineNumber = lineNumber;
1857 error.column = index - lineStart + 1;
1858 }
1859
1860 error.description = msg;
1861 throw error;
1862 }
1863
1864 function throwErrorTolerant() {
1865 try {

Callers 15

skipMultiLineCommentFunction · 0.85
getEscapedIdentifierFunction · 0.85
scanPunctuatorFunction · 0.85
scanHexLiteralFunction · 0.85
scanOctalLiteralFunction · 0.85
scanNumericLiteralFunction · 0.85
scanStringLiteralFunction · 0.85
testRegExpFunction · 0.85
scanRegExpBodyFunction · 0.85
throwUnexpectedFunction · 0.85
parseContinueStatementFunction · 0.85
parseBreakStatementFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected