MCPcopy Index your code
hub / github.com/reactjs/react-rails / throwError

Function throwError

lib/assets/javascripts/JSXTransformer.js:5102–5127  ·  view source on GitHub ↗
(token, messageFormat)

Source from the content-addressed store, hash-verified

5100 // Throw an exception
5101
5102 function throwError(token, messageFormat) {
5103 var error,
5104 args = Array.prototype.slice.call(arguments, 2),
5105 msg = messageFormat.replace(
5106 /%(\d)/g,
5107 function (whole, idx) {
5108 assert(idx < args.length, 'Message reference must be in range');
5109 return args[idx];
5110 }
5111 );
5112
5113 if (typeof token.lineNumber === 'number') {
5114 error = new Error('Line ' + token.lineNumber + ': ' + msg);
5115 error.index = token.range[0];
5116 error.lineNumber = token.lineNumber;
5117 error.column = token.range[0] - lineStart + 1;
5118 } else {
5119 error = new Error('Line ' + lineNumber + ': ' + msg);
5120 error.index = index;
5121 error.lineNumber = lineNumber;
5122 error.column = index - lineStart + 1;
5123 }
5124
5125 error.description = msg;
5126 throw error;
5127 }
5128
5129 function throwErrorTolerant() {
5130 try {

Callers 15

skipMultiLineCommentFunction · 0.85
getEscapedIdentifierFunction · 0.85
scanPunctuatorFunction · 0.85
scanHexLiteralFunction · 0.85
scanBinaryLiteralFunction · 0.85
scanOctalLiteralFunction · 0.85
scanNumericLiteralFunction · 0.85
scanStringLiteralFunction · 0.85
scanTemplateFunction · 0.85
scanTemplateElementFunction · 0.85
testRegExpFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected