MCPcopy Create free account
hub / github.com/microsoft/SandDance / throwError

Function throwError

docs/tests/v2/es6/js/sanddance.js:128860–128871  ·  view source on GitHub ↗
(token, messageFormat)

Source from the content-addressed store, hash-verified

128858
128859
128860function throwError(token, messageFormat) {
128861 var error,
128862 args = Array.prototype.slice.call(arguments, 2),
128863 msg = messageFormat.replace(/%(\d)/g, function (whole, index) {
128864 assert(index < args.length, 'Message reference must be in range');
128865 return args[index];
128866 });
128867 error = new Error(msg);
128868 error.index = index;
128869 error.description = msg;
128870 throw error;
128871} // Throw an exception because of the token.
128872
128873
128874function throwUnexpected(token) {

Callers 15

scanHexEscapeFunction · 0.70
getEscapedIdentifierFunction · 0.70
scanPunctuatorFunction · 0.70
scanHexLiteralFunction · 0.70
scanOctalLiteralFunction · 0.70
scanNumericLiteralFunction · 0.70
scanStringLiteralFunction · 0.70
testRegExpFunction · 0.70
scanRegExpBodyFunction · 0.70
scanRegExpFlagsFunction · 0.70
throwUnexpectedFunction · 0.70

Calls 2

replaceMethod · 0.80
assertFunction · 0.70

Tested by

no test coverage detected