Examples of ErrorReporter


Examples of org.mozilla.javascript.ErrorReporter

                            logger.getName()));
                }
            }
        };

        ErrorReporter errorReporter = new ErrorReporter()
        {
            private String format(String message, int line, int lineOffset)
            {
                if (line < 0)
                    return message;
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

        srcChannel.close();
        dstChannel.close();
    }

    private JavaScriptCompressor createJavaScriptCompressor(final Reader in) throws IOException {
        final JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() {

            public void error(final String message, final String sourceName, final int line, final String lineSource,
                    final int lineOffset) {
                log(getMessage(sourceName, message, line, lineOffset), Project.MSG_ERR);
            }
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

      }
     
        try {
         
            Optimizer builder = new Optimizer();
            ErrorReporter reporter = new DefaultErrorReporter(getLog(), true);
            builder.build( optimizeBuildDir, providePlugins, createBuildProfile(), reporter );
            moveModulesToOutputDir();

        } catch (RuntimeException exc) {
            throw exc;
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

import org.mozilla.javascript.tools.ToolErrorReporter;

public class JQueryScanner {

  public JQueryScanner(FileReader in) {
    final ErrorReporter reporter = new ToolErrorReporter(true);
    final CompilerEnvirons env = new CompilerEnvirons();
    final Parser parser = new Parser(env, reporter);

    try {
      parser.parse(in, null, 0);
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

    return out.toString();
  }
  public static String compressJS(Reader in) throws IOException{
    StringWriter out = new StringWriter();
    try {
      JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() {
        public void warning(String message, String sourceName,
            int line, String lineSource, int lineOffset) {
          log.warn("[JAVASCRIPT COMPRESSOR WARN] in file : "+sourceName+"\n"+message+"\n"+line+":"+lineOffset);
        }
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

   * @param out the writer where the data must be written
   * @throws IOException
   */
  public static void compressJS(Reader in, Writer out) throws IOException{
    try {
      JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() {
        public void warning(String message, String sourceName,
            int line, String lineSource, int lineOffset) {
          LOG.warn("[JAVASCRIPT COMPRESSOR WARN] in file : "+sourceName+"\n"+message+"\n"+line+":"+lineOffset);
        }

View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

   * 创建JavaScript压缩器
   */
  public JSCompressor() {

    /** 创建向控制台进行错误输出的对象 */
    this.reporter = new ErrorReporter() {

      public void warning(String message, String sourceName, int line,
          String lineSource, int lineOffset) {
        if (line < 0) {
          System.err.println("\n[WARNING] " + message);
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

    public JavaScriptResourceMinimizer(final Logger logger, OperationTracker tracker)
    {
        super(logger, tracker, "JavaScript");

        errorReporter = new ErrorReporter()
        {
            private String format(String message, int line, int lineOffset)
            {
                if (line < 0)
                    return message;
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

    try {
      // Initialize the standard objects (Object, Function, etc.)
      // This must be done before scripts can be executed. Returns
      // a scope object that we use in later calls.
      Scriptable scope = cx.initStandardObjects();
      cx.setErrorReporter(new ErrorReporter() {

        @Override
        public void warning(String arg0, String arg1, int arg2,
            String arg3, int arg4) {
          System.err.println(String.format("%s %s %s %s %s", arg0,
View Full Code Here

Examples of org.mozilla.javascript.ErrorReporter

    try {
      Timer timer = new Timer();     
      // logger.debug( "Starting minification for '" + inputFilename + "'...");
      Reader in = new StringReader( input );
      JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() {
        public void warning(String message, String sourceName,
            int line, String lineSource, int lineOffset) {
          if (line < 0) {
            logger.warn("Minifier Warning: " + message);
          } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.