(messageFormat)
| 2063 | } |
| 2064 | |
| 2065 | function tolerateError(messageFormat) { |
| 2066 | var args, msg, error; |
| 2067 | |
| 2068 | args = Array.prototype.slice.call(arguments, 1); |
| 2069 | /* istanbul ignore next */ |
| 2070 | msg = messageFormat.replace(/%(\d)/g, |
| 2071 | function (whole, idx) { |
| 2072 | assert(idx < args.length, 'Message reference must be in range'); |
| 2073 | return args[idx]; |
| 2074 | } |
| 2075 | ); |
| 2076 | |
| 2077 | error = createError(lineNumber, lastIndex, msg); |
| 2078 | if (extra.errors) { |
| 2079 | recordError(error); |
| 2080 | } else { |
| 2081 | throw error; |
| 2082 | } |
| 2083 | } |
| 2084 | |
| 2085 | // Throw an exception because of the token. |
| 2086 |
no test coverage detected