(token, messageFormat)
| 128858 | |
| 128859 | |
| 128860 | function 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 | |
| 128874 | function throwUnexpected(token) { |
no test coverage detected