Class DefaultErrorReporter

java.lang.Object
org.mozilla.javascript.DefaultErrorReporter
All Implemented Interfaces:
ErrorReporter

class DefaultErrorReporter extends Object implements ErrorReporter
This is the default error reporter for JavaScript.
  • Field Details

  • Constructor Details

    • DefaultErrorReporter

      private DefaultErrorReporter()
  • Method Details

    • forEval

      static ErrorReporter forEval(ErrorReporter reporter)
    • warning

      public void warning(String message, String sourceURI, int line, String lineText, int lineOffset)
      Description copied from interface: ErrorReporter
      Report a warning. The implementing class may choose to ignore the warning if it desires.
      Specified by:
      warning in interface ErrorReporter
      Parameters:
      message - a String describing the warning
      sourceURI - a String describing the JavaScript source where the warning occured; typically a filename or URL
      line - the line number associated with the warning
      lineText - the text of the line (may be null)
      lineOffset - the offset into lineSource where problem was detected
    • error

      public void error(String message, String sourceURI, int line, String lineText, int lineOffset)
      Description copied from interface: ErrorReporter
      Report 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:
      error in interface ErrorReporter
      Parameters:
      message - a String describing the error
      sourceURI - a String describing the JavaScript source where the error occured; typically a filename or URL
      line - the line number associated with the error
      lineText - the text of the line (may be null)
      lineOffset - the offset into lineSource where problem was detected
    • runtimeError

      public EvaluatorException runtimeError(String message, String sourceURI, int line, String lineText, int lineOffset)
      Description copied from interface: ErrorReporter
      Creates an EvaluatorException that may be thrown. runtimeErrors, unlike errors, will always terminate the current script.
      Specified by:
      runtimeError in interface ErrorReporter
      Parameters:
      message - a String describing the error
      sourceURI - a String describing the JavaScript source where the error occured; typically a filename or URL
      line - the line number associated with the error
      lineText - the text of the line (may be null)
      lineOffset - the offset into lineSource where problem was detected
      Returns:
      an EvaluatorException that will be thrown.