Lines Matching refs:error

36  * Helper class to throw various standard "ECMA error" exceptions such as Error, ReferenceError, TypeError etc.
56 private static ECMAException error(final Object thrown, final Throwable cause) {
62 * Create a {@link ParserException} as the correct JavaScript error
64 * @param e {@code ParserException} for error dispatcher
74 * Create a {@link ParserException} as the correct JavaScript error
77 * @param e {@code ParserException} for error dispatcher
83 assert errorType != null : "error type for " + e + " was null";
88 // translate to ECMAScript Error object using error type
91 return error(globalObj.newError(msg), e);
93 return error(globalObj.newEvalError(msg), e);
95 return error(globalObj.newRangeError(msg), e);
97 return error(globalObj.newReferenceError(msg), e);
99 return error(globalObj.newSyntaxError(msg), e);
101 return error(globalObj.newTypeError(msg), e);
103 return error(globalObj.newURIError(msg), e);
105 // should not happen - perhaps unknown error type?
111 * Create a syntax error (ECMA 15.11.6.4)
113 * @param msgId resource tag for error message
123 * Create a syntax error (ECMA 15.11.6.4)
126 * @param msgId resource tag for error message
136 * Create a syntax error (ECMA 15.11.6.4)
138 * @param cause native Java {@code Throwable} that is the cause of error
139 * @param msgId resource tag for error message
149 * Create a syntax error (ECMA 15.11.6.4)
152 * @param cause native Java {@code Throwable} that is the cause of error
153 * @param msgId resource tag for error message
159 final String msg = getMessage("syntax.error." + msgId, args);
160 return error(global.newSyntaxError(msg), cause);
164 * Create a type error (ECMA 15.11.6.5)
166 * @param msgId resource tag for error message
176 * Create a type error (ECMA 15.11.6.5)
179 * @param msgId resource tag for error message
189 * Create a type error (ECMA 15.11.6.5)
191 * @param cause native Java {@code Throwable} that is the cause of error
192 * @param msgId resource tag for error message
202 * Create a type error (ECMA 15.11.6.5)
205 * @param cause native Java {@code Throwable} that is the cause of error
206 * @param msgId resource tag for error message
212 final String msg = getMessage("type.error." + msgId, args);
213 return error(global.newTypeError(msg), cause);
217 * Create a range error (ECMA 15.11.6.2)
219 * @param msgId resource tag for error message
229 * Create a range error (ECMA 15.11.6.2)
232 * @param msgId resource tag for error message
242 * Create a range error (ECMA 15.11.6.2)
244 * @param cause native Java {@code Throwable} that is the cause of error
245 * @param msgId resource tag for error message
255 * Create a range error (ECMA 15.11.6.2)
258 * @param cause native Java {@code Throwable} that is the cause of error
259 * @param msgId resource tag for error message
265 final String msg = getMessage("range.error." + msgId, args);
266 return error(global.newRangeError(msg), cause);
270 * Create a reference error (ECMA 15.11.6.3)
272 * @param msgId resource tag for error message
282 * Create a reference error (ECMA 15.11.6.3)
285 * @param msgId resource tag for error message
295 * Create a reference error (ECMA 15.11.6.3)
297 * @param cause native Java {@code Throwable} that is the cause of error
298 * @param msgId resource tag for error message
308 * Create a reference error (ECMA 15.11.6.3)
311 * @param cause native Java {@code Throwable} that is the cause of error
312 * @param msgId resource tag for error message
318 final String msg = getMessage("reference.error." + msgId, args);
319 return error(global.newReferenceError(msg), cause);
323 * Create a URI error (ECMA 15.11.6.6)
325 * @param msgId resource tag for error message
335 * Create a URI error (ECMA 15.11.6.6)
338 * @param msgId resource tag for error message
348 * Create a URI error (ECMA 15.11.6.6)
350 * @param cause native Java {@code Throwable} that is the cause of error
351 * @param msgId resource tag for error message
361 * Create a URI error (ECMA 15.11.6.6)
364 * @param cause native Java {@code Throwable} that is the cause of error
365 * @param msgId resource tag for error message
371 final String msg = getMessage("uri.error." + msgId, args);
372 return error(global.newURIError(msg), cause);
381 * @param args arguments to error string
383 * @return the filled out error string