/** * @deprecated Use {@link Context#exit()} instead. */ public final void exit() { Context.exit(); }
public void after() { Context.exit(); }
private String executeScript(String fileName) throws ProcessingException { String result; try { Main.processSource(cx, fileName); result = out.toString(Charsets.UTF_8.name()); } catch (Exception e) { throw new ProcessingException(e.getMessage(), e); } finally { Context.exit(); } return result; }
private String executeScript(String fileName) throws ProcessingException { String result; try { Main.processSource(cx, fileName); result = out.toString(Charsets.UTF_8.name()); } catch (Exception e) { throw new ProcessingException(e.getMessage(), e); } finally { Context.exit(); } return result; }
/** * The method implements {@link ContextFactory#call(ContextAction)} logic. */ static Object call(ContextFactory factory, ContextAction action) { Context cx = enter(null, factory); try { return action.run(cx); } finally { exit(); } }
Context.exit();
Context.exit();
Context.exit();
JavaMembers(Scriptable scope, Class<?> cl, boolean includeProtected) { try { Context cx = ContextFactory.getGlobal().enterContext(); ClassShutter shutter = cx.getClassShutter(); if (shutter != null && !shutter.visibleToScripts(cl.getName())) { throw Context.reportRuntimeError1("msg.access.prohibited", cl.getName()); } this.includePrivate = cx.hasFeature( Context.FEATURE_ENHANCED_JAVA_ACCESS); this.members = new HashMap<String,Object>(); this.staticMembers = new HashMap<String,Object>(); this.cl = cl; reflect(scope, includeProtected); } finally { Context.exit(); } }
/** * Calls the {@code callback} given in parameter once for each value pair in the list, in insertion order. * @param callback function to execute for each element */ @JsxFunction({CHROME, FF}) public void forEach(final Object callback) { final List<DomNode> nodes = getElements(); final Context context = Context.enter(); try { final Function function = (Function) callback; final Scriptable scope = getParentScope(); for (int i = 0; i < nodes.size(); i++) { function.call(context, scope, this, new Object[] { nodes.get(i).getScriptableObject(), i, this}); } } finally { Context.exit(); } } }
/** * Calls the {@code callback} given in parameter once for each value pair in the list, in insertion order. * @param callback function to execute for each element */ @JsxFunction({CHROME, FF}) public void forEach(final Object callback) { final List<DomNode> nodes = getElements(); final Context context = Context.enter(); try { final Function function = (Function) callback; final Scriptable scope = getParentScope(); for (int i = 0; i < nodes.size(); i++) { function.call(context, scope, this, new Object[] { nodes.get(i).getScriptableObject(), i, this}); } } finally { Context.exit(); } } }
Context.exit();
/** * Creates a new event instance. * * @param target the event target * @param type the event type * @param state the state object */ public PopStateEvent(final EventTarget target, final String type, final Object state) { super(target, type); if (state instanceof NativeObject && getBrowserVersion().hasFeature(JS_POP_STATE_EVENT_CLONE_STATE)) { final NativeObject old = (NativeObject) state; final NativeObject newState = new NativeObject(); Context.enter(); try { for (final Object o : ScriptableObject.getPropertyIds(old)) { final String property = Context.toString(o); newState.defineProperty(property, ScriptableObject.getProperty(old, property), ScriptableObject.EMPTY); } } finally { Context.exit(); } state_ = newState; } else { state_ = state; } }
/** * Creates a new event instance. * * @param target the event target * @param type the event type * @param state the state object */ public PopStateEvent(final EventTarget target, final String type, final Object state) { super(target, type); if (state instanceof NativeObject && getBrowserVersion().hasFeature(JS_POP_STATE_EVENT_CLONE_STATE)) { final NativeObject old = (NativeObject) state; final NativeObject newState = new NativeObject(); Context.enter(); try { for (final Object o : ScriptableObject.getPropertyIds(old)) { final String property = Context.toString(o); newState.defineProperty(property, ScriptableObject.getProperty(old, property), ScriptableObject.EMPTY); } } finally { Context.exit(); } state_ = newState; } else { state_ = state; } }
Context.exit();
Context.exit();
Context.exit();
Context.exit();