static void init() { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new CustomContextFactory()); } } }
public void initialize() { if (!initialized) { if ("true".equals(getProperty(USE_INTERPRETER_SYSTEM_PROPERTY))) { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new ContextFactory() { protected Context makeContext() { Context cx = super.makeContext(); cx.setOptimizationLevel(-1); return cx; } }); } } if (listener != null) { ContextFactory.getGlobal().addListener(listener); } initialized = true; } }
public void initialize() { if (!initialized) { if ("true".equals(getProperty(USE_INTERPRETER_SYSTEM_PROPERTY))) { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new ContextFactory() { @Override protected Context makeContext() { Context cx = super.makeContext(); cx.setOptimizationLevel(-1); return cx; } }); } } if (listener != null) { ContextFactory.getGlobal().addListener(listener); } initialized = true; } }
public void initialize() { if (!initialized) { if ("true".equals(getProperty(USE_INTERPRETER_SYSTEM_PROPERTY))) { if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new ContextFactory() { protected Context makeContext() { Context cx = super.makeContext(); cx.setOptimizationLevel(-1); return cx; } }); } } if (listener != null) { ContextFactory.getGlobal().addListener(listener); } initialized = true; } }
JavaScriptE4XAxiomHelper(ScriptEngine engine) { // tell Rhino to use Axiom E4X impl if (!ContextFactory.hasExplicitGlobal()) { ContextFactory.initGlobal(new AxiomE4XContextFactory()); } Context cx = Context.enter(); try { this.scope = cx.initStandardObjects(); } finally { Context.exit(); } }