Search in sources :

Example 6 with ToolErrorReporter

use of org.mozilla.javascript.tools.ToolErrorReporter in project Auto.js by hyb1996.

the class Main method exec.

/**
 * Execute the given arguments, but don't System.exit at the end.
 */
public static int exec(String[] origArgs) {
    errorReporter = new ToolErrorReporter(false, global.getErr());
    shellContextFactory.setErrorReporter(errorReporter);
    String[] args = processOptions(origArgs);
    if (exitCode > 0) {
        return exitCode;
    }
    if (processStdin) {
        fileList.add(null);
    }
    if (true) {
        global.init(shellContextFactory);
    }
    IProxy iproxy = new IProxy(IProxy.PROCESS_FILES);
    iproxy.args = args;
    shellContextFactory.call(iproxy);
    return exitCode;
}
Also used : ToolErrorReporter(org.mozilla.javascript.tools.ToolErrorReporter)

Aggregations

ToolErrorReporter (org.mozilla.javascript.tools.ToolErrorReporter)6 CompilerEnvirons (org.mozilla.javascript.CompilerEnvirons)2 ErrorReporter (org.mozilla.javascript.ErrorReporter)2 NodeTransformer (org.mozilla.javascript.NodeTransformer)2 Parser (org.mozilla.javascript.Parser)2 ScriptNode (org.mozilla.javascript.ast.ScriptNode)2 EvaluatorException (org.mozilla.javascript.EvaluatorException)1