Package org.mozilla.javascript

Examples of org.mozilla.javascript.CompilerEnvirons


    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


  {
    Class<?> clazz = classCache.get(script);
    if (clazz == null)
    {
      String name = "script" + count++;
      CompilerEnvirons env = new CompilerEnvirons();
      env.setOptimizationLevel(0);
      ClassCompiler classCompiler = new ClassCompiler(env);
      Object[] ret = classCompiler.compileToClassFiles(script, name + ".js", 1, name);
      codeCache.put(name, (byte[])ret[1]);
      classCache.put(name, clazz = cl.loadClass(name));
    }
View Full Code Here

      /* initialize JavaScript context */
      Context cx = Context.enter();

      /* create a new parser */
      Parser rhinoParser = new Parser(new CompilerEnvirons(), cx.getErrorReporter());

      /* parse some script and save it in AST */
      ast = rhinoParser.parse(new String(input), scopename, 0);

      modifier.setScopeName(scopename);
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.CompilerEnvirons

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.