public Object run(Context cx) { init(cx); return null; } });
public Object run(Context cx) { init(cx); return null; } });
public Object run(Context cx) { init(cx); return null; } });
public Global(Context cx) { init(cx); }
public Global(Context cx) { init(cx); }
public Global(Context cx) { init(cx); }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Dim mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
synchronized void init() { if ( ! inited ) { Context c = Context.enter(); c.setOptimizationLevel( -1 ); Global g = Main.getGlobal(); g.init( c ); inited = true; } }
protected void compress() throws IOException { URL cssmin = getClass().getClassLoader().getResource( "META-INF/cssmin.js"); Context cx = Context.enter(); cx.setOptimizationLevel(9); Global global = new Global(); global.init(cx); Scriptable scope = cx.initStandardObjects(global); cx.evaluateString(scope, "var exports = {};", "exports", 1, null); cx.evaluateReader(scope, new InputStreamReader(cssmin.openConnection() .getInputStream()), cssmin.getFile(), 1, null); Scriptable exports = (Scriptable) scope.get("exports", scope); Scriptable compressor = (Scriptable) exports.get("compressor", exports); Function fn = (Function) compressor.get("cssmin", compressor); content = ((String) Context.call(null, fn, compressor, compressor, new Object[] { new String(content, charset).replaceFirst( "^/\\*", "/*!") })).getBytes(charset); Context.exit(); }
public Rhino1_7R3Context() { Context ctx = Context.enter(); try { ctx.setOptimizationLevel(1); ctx.setLanguageVersion(Context.VERSION_1_7); // Global global = new Global(); global.init(ctx); this.global = global; this.ctx = ctx; this.scope = ctx.initStandardObjects(global); this.classCache = new HashMap<String, Class<?>>(); this.codeCache = new HashMap<String, byte[]>(); } finally { Context.exit(); } }
public Rhino1_7R3Context() { Context ctx = Context.enter(); try { ctx.setOptimizationLevel(1); ctx.setLanguageVersion(Context.VERSION_1_7); // Global global = new Global(); global.init(ctx); this.global = global; this.ctx = ctx; this.scope = ctx.initStandardObjects(global); this.classCache = new HashMap<String, Class<?>>(); this.codeCache = new HashMap<String, byte[]>(); } finally { Context.exit(); } }
/** * 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 (processStdin) { fileList.add(null); } if (!global.initialized) { global.init(shellContextFactory); } IProxy iproxy = new IProxy(IProxy.PROCESS_FILES); iproxy.args = args; shellContextFactory.call(iproxy); return exitCode; }
/** * 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 (processStdin) fileList.add(null); if (!global.initialized) { global.init(shellContextFactory); } IProxy iproxy = new IProxy(IProxy.PROCESS_FILES); iproxy.args = args; shellContextFactory.call(iproxy); return exitCode; }
/** * 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 (processStdin) { fileList.add(null); } if (!global.initialized) { global.init(shellContextFactory); } IProxy iproxy = new IProxy(IProxy.PROCESS_FILES); iproxy.args = args; shellContextFactory.call(iproxy); return exitCode; }
public static void main(String[] args) { errorReporter = new ToolErrorReporter(false, global.getErr()); shellContextFactory.setErrorReporter(errorReporter); IProxy iproxy = new IProxy(IProxy.PROCESS_FILES, processOptions(args)); global.init(shellContextFactory); shellContextFactory.call(iproxy); }
/** * Activate the Debugger */ public synchronized void activate() { factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); global.setIn(System.in); global.setOut(System.out); global.setErr(System.err); initDebugger(); ScopeProvider sp = new AlfrescoScopeProvider((Scriptable)global); dim.setScopeProvider(sp); gui = new AlfrescoGui(dim, getTitle(), this); gui.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); gui.setExitAction(this); }
/** * Activate the Debugger */ public synchronized void activate() { factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); global.setIn(System.in); global.setOut(System.out); global.setErr(System.err); initDebugger(); ScopeProvider sp = new AlfrescoScopeProvider((Scriptable)global); dim.setScopeProvider(sp); gui = new AlfrescoGui(dim, getTitle(), this); gui.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); gui.setExitAction(this); }
/** * Activate the Debugger */ public synchronized void activate() { factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); global.setIn(System.in); global.setOut(System.out); global.setErr(System.err); initDebugger(); ScopeProvider sp = new AlfrescoScopeProvider((Scriptable)global); dim.setScopeProvider(sp); gui = new AlfrescoGui(dim, getTitle(), this); gui.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); gui.setExitAction(this); }