(messageFormat)
| 2049 | // Throw an exception |
| 2050 | |
| 2051 | function throwError(messageFormat) { |
| 2052 | var args, msg; |
| 2053 | |
| 2054 | args = Array.prototype.slice.call(arguments, 1); |
| 2055 | msg = messageFormat.replace(/%(\d)/g, |
| 2056 | function (whole, idx) { |
| 2057 | assert(idx < args.length, 'Message reference must be in range'); |
| 2058 | return args[idx]; |
| 2059 | } |
| 2060 | ); |
| 2061 | |
| 2062 | throw createError(lastLineNumber, lastIndex, msg); |
| 2063 | } |
| 2064 | |
| 2065 | function tolerateError(messageFormat) { |
| 2066 | var args, msg, error; |
no test coverage detected