Package org.mozilla.javascript.tools

Examples of org.mozilla.javascript.tools.ToolErrorReporter


    private final Object lock0 = new Object();

    public CacheManager(CompilerEnvirons compilerEnv) {
        if (compilerEnv == null) {
            compilerEnv = new CompilerEnvirons();
            compilerEnv.setErrorReporter(new ToolErrorReporter(true));
        }
        this.compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here


   */
  private ScriptableObject createContext(final ScriptableObject initialScope) {
    final Context context = getContext();
    context.setOptimizationLevel(-1);
    // TODO redirect errors from System.err to LOG.error()
    context.setErrorReporter(new ToolErrorReporter(false));
    context.setLanguageVersion(Context.VERSION_1_8);
    InputStream script = null;
    final ScriptableObject scriptCommon = (ScriptableObject) context.initStandardObjects(initialScope);
    try {
      script = getClass().getResourceAsStream("commons.js");
View Full Code Here

  public static <V> V execute(final JsTask<V> task) throws IOException {
    Context context = null;
    try {
      context = Context.enter();
      context.setOptimizationLevel(-1);
      context.setErrorReporter(new ToolErrorReporter(false));
      context.setLanguageVersion(Context.VERSION_1_8);

      Global global = new Global();
      global.init(context);
View Full Code Here

        ByteArrayOutputStream err = new ByteArrayOutputStream();
        this.setOut(new PrintStream(out));
        this.setErr(new PrintStream(err));
        String resultString = "";
        ErrorReporter savedErrorReporter = cx.getErrorReporter();
        cx.setErrorReporter(new ToolErrorReporter(false, this.getErr()));
        try {
            testCount++;
          Object result = cx.evaluateString(scope, inputString,
                          "doctest input", 1, null);
              if (result != Context.getUndefinedValue() &&
View Full Code Here

    /**
     *  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);
        shellContextFactory.setLanguageVersion(Context.VERSION_1_8);
        //shellContextFactory.setStrictMode(true);
        //errorReporter.setIsReportingWarnings(true);
        String[] args = processOptions(origArgs);
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.tools.ToolErrorReporter

Copyright © 2018 www.massapicom. 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.