@Override public Object run(final Context cx) { cx.setOptimizationLevel(-1); final Script script = cx.compileString(scriptSource, scriptName, 0, null); return cx.decompileScript(script, 4); } };
@Override public Object run(final Context cx) { cx.setOptimizationLevel(-1); final Script script = cx.compileString(scriptSource, scriptName, 0, null); return cx.decompileScript(script, 4); } };
/** * Specify whether or not debug information should be generated. * <p> * Setting the generation of debug information on will set the * optimization level to zero. * @since 1.3 */ public final void setGeneratingDebug(boolean generatingDebug) { if (sealed) onSealedMutation(); generatingDebugChanged = true; if (generatingDebug && getOptimizationLevel() > 0) setOptimizationLevel(0); this.generatingDebug = generatingDebug; }
private void init() { cx = ContextFactory.getGlobal().enterContext(); cx.setOptimizationLevel(-1); cx.setLanguageVersion(Context.VERSION_1_5); global = Main.getGlobal(); if (!global.isInitialized()) { global.init(cx); } out = new ByteArrayOutputStream(); PrintStream printStream = null; try { printStream = new PrintStream(out, false, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("Can't encode js runtime.", e); } Main.setOut(printStream); Main.setErr(printStream); }
@Override protected void onContextCreated(Context cx) { cx.setLanguageVersion(languageVersion); cx.setOptimizationLevel(optimizationLevel); if (errorReporter != null) { cx.setErrorReporter(errorReporter); } cx.setGeneratingDebug(generatingDebug); super.onContextCreated(cx); }
private void init() { cx = ContextFactory.getGlobal().enterContext(); cx.setOptimizationLevel(-1); cx.setLanguageVersion(Context.VERSION_1_5); global = Main.getGlobal(); if (!global.isInitialized()) { global.init(cx); } out = new ByteArrayOutputStream(); PrintStream printStream = null; try { printStream = new PrintStream(out, false, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { LOGGER.error("Can't encode js runtime.", e); } Main.setOut(printStream); Main.setErr(printStream); }
/** * Called when a Context is created. */ public void contextCreated(Context cx) { if (type != IPROXY_LISTEN) Kit.codeBug(); ContextData contextData = new ContextData(); Debugger debugger = new DimIProxy(dim, IPROXY_DEBUG); cx.setDebugger(debugger, contextData); cx.setGeneratingDebug(true); cx.setOptimizationLevel(-1); }
cx.setOptimizationLevel(-1); cx.setGeneratingDebug(false); try { } finally { cx.setGeneratingDebug(true); cx.setOptimizationLevel(saved_level); cx.setDebugger(saved_debugger, saved_data);
HtmlUnitContextFactory factory = sriptEngine.getContextFactory(); Context context = factory.enterContext(); context.setOptimizationLevel(9);