Package org.htmlunit.corejs.javascript
Class DefaultErrorReporter
- java.lang.Object
-
- org.htmlunit.corejs.javascript.DefaultErrorReporter
-
- All Implemented Interfaces:
ErrorReporter
class DefaultErrorReporter extends java.lang.Object implements ErrorReporter
This is the default error reporter for JavaScript.
-
-
Field Summary
Fields Modifier and Type Field Description private ErrorReporterchainedReporterprivate booleanforEval(package private) static DefaultErrorReporterinstance
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultErrorReporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(java.lang.String message, java.lang.String sourceURI, int line, java.lang.String lineText, int lineOffset)Report an error.(package private) static ErrorReporterforEval(ErrorReporter reporter)EvaluatorExceptionruntimeError(java.lang.String message, java.lang.String sourceURI, int line, java.lang.String lineText, int lineOffset)Creates an EvaluatorException that may be thrown.voidwarning(java.lang.String message, java.lang.String sourceURI, int line, java.lang.String lineText, int lineOffset)Report a warning.
-
-
-
Field Detail
-
instance
static final DefaultErrorReporter instance
-
forEval
private boolean forEval
-
chainedReporter
private ErrorReporter chainedReporter
-
-
Method Detail
-
forEval
static ErrorReporter forEval(ErrorReporter reporter)
-
warning
public void warning(java.lang.String message, java.lang.String sourceURI, int line, java.lang.String lineText, int lineOffset)Description copied from interface:ErrorReporterReport a warning.The implementing class may choose to ignore the warning if it desires.
- Specified by:
warningin interfaceErrorReporter- Parameters:
message- a String describing the warningsourceURI- a String describing the JavaScript source where the warning occured; typically a filename or URLline- the line number associated with the warninglineText- the text of the line (may be null)lineOffset- the offset into lineSource where problem was detected
-
error
public void error(java.lang.String message, java.lang.String sourceURI, int line, java.lang.String lineText, int lineOffset)Description copied from interface:ErrorReporterReport an error.The implementing class is free to throw an exception if it desires.
If execution has not yet begun, the JavaScript engine is free to find additional errors rather than terminating the translation. It will not execute a script that had errors, however.
- Specified by:
errorin interfaceErrorReporter- Parameters:
message- a String describing the errorsourceURI- a String describing the JavaScript source where the error occured; typically a filename or URLline- the line number associated with the errorlineText- the text of the line (may be null)lineOffset- the offset into lineSource where problem was detected
-
runtimeError
public EvaluatorException runtimeError(java.lang.String message, java.lang.String sourceURI, int line, java.lang.String lineText, int lineOffset)
Description copied from interface:ErrorReporterCreates an EvaluatorException that may be thrown.runtimeErrors, unlike errors, will always terminate the current script.
- Specified by:
runtimeErrorin interfaceErrorReporter- Parameters:
message- a String describing the errorsourceURI- a String describing the JavaScript source where the error occured; typically a filename or URLline- the line number associated with the errorlineText- the text of the line (may be null)lineOffset- the offset into lineSource where problem was detected- Returns:
- an EvaluatorException that will be thrown.
-
-