Package com.google.javascript.rhino
Class SimpleErrorReporter
java.lang.Object
com.google.javascript.rhino.SimpleErrorReporter
- All Implemented Interfaces:
ErrorReporter
A simple
ErrorReporter
that collects warnings and errors and makes
them accessible via errors()
and warnings()
.-
Constructor Details
-
SimpleErrorReporter
public SimpleErrorReporter()
-
-
Method Details
-
warning
Description copied from interface:ErrorReporter
Report a warning. The implementing class may choose to ignore the warning if it desires.- Specified by:
warning
in interfaceErrorReporter
- Parameters:
message
- a String describing the warningsourceName
- a String describing the JavaScript source where the warning occurred; typically a filename or URLline
- the line number associated with the warninglineOffset
- the offset into lineSource where problem was detected
-
error
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 interfaceErrorReporter
- Parameters:
message
- a String describing the errorsourceName
- a String describing the JavaScript source where the error occurred; typically a filename or URLline
- the line number associated with the errorlineOffset
- the offset into lineSource where problem was detected
-
errors
Returns the list of errors, ornull
if there were none. -
warnings
Returns the list of warnings, ornull
if there were none.
-