Package com.samaxes.maven.minify.common
Class JavaScriptErrorReporter
java.lang.Object
com.samaxes.maven.minify.common.JavaScriptErrorReporter
- All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter
A Rhino compatible error reporter.
-
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptErrorReporter
(org.apache.maven.plugin.logging.Log log, String filename) Error reporter constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Reports an error.org.mozilla.javascript.EvaluatorException
runtimeError
(String message, String sourceName, int line, String lineSource, int lineOffset) Creates an EvaluatorException that may be thrown. runtimeErrors, unlike errors, will always terminate the current script.void
Reports a warning.
-
Constructor Details
-
JavaScriptErrorReporter
Error reporter constructor.- Parameters:
log
- Maven plugin logfilename
- JavaScript source file name
-
-
Method Details
-
warning
Reports a warning.- Specified by:
warning
in interfaceorg.mozilla.javascript.ErrorReporter
- Parameters:
message
- a String describing the warningsourceName
- a String describing the JavaScript source where the warning occurred; typically a file name or URLline
- the line number associated with the warninglineSource
- the text of the line (may be null)lineOffset
- the offset into lineSource where problem was detected
-
error
Reports an error. If execution has not yet begun, the JavaScript engine is free to find additional errors rather than terminating the translation. However, it will not execute a script that had errors.- Specified by:
error
in interfaceorg.mozilla.javascript.ErrorReporter
- Parameters:
message
- a String describing the warningsourceName
- a String describing the JavaScript source where the warning occurred; typically a file name or URLline
- the line number associated with the warninglineSource
- the text of the line (may be null)lineOffset
- the offset into lineSource where problem was detected
-
runtimeError
public org.mozilla.javascript.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) Creates an EvaluatorException that may be thrown. runtimeErrors, unlike errors, will always terminate the current script.- Specified by:
runtimeError
in interfaceorg.mozilla.javascript.ErrorReporter
- Parameters:
message
- a String describing the warningsourceName
- a String describing the JavaScript source where the warning occurred; typically a file name or URLline
- the line number associated with the warninglineSource
- the text of the line (may be null)lineOffset
- the offset into lineSource where problem was detected
-