/** * To be used by <code>WindowWrapper</code>. */ void callHandler(final Function handler, final Object[] args) { contextFactory.call(new ContextAction() { public Object run(Context cx) { handler.call(cx, globalObject, globalObject, args); return null; } }); }
/** * To be used by <code>WindowWrapper</code>. */ void callHandler(final Function handler, final ArgumentsBuilder ab) { contextFactory.call(new ContextAction() { public Object run(Context cx) { Object[] args = ab.buildArguments(); handler.call(cx, handler.getParentScope(), globalObject, args); return null; } }); }
/** * To be used by <code>EventTargetWrapper</code>. */ Object call(ContextAction action) { return contextFactory.call(action); }
public void init(ContextFactory factory) { factory.call(new ContextAction() { public Object run(Context cx) { init(cx); return null; } }); }
/** * To be used by <code>WindowWrapper</code>. */ void callHandler(final Function handler, final Object[] args) { contextFactory.call(new ContextAction() { public Object run(Context cx) { handler.call(cx, globalObject, globalObject, args); return null; } }); }
/** * To be used by <code>EventTargetWrapper</code>. */ Object call(ContextAction action) { return contextFactory.call(action); }
/** * Performs the action given by {@link #type} with the attached * {@link ContextFactory}. */ private void withContext() { dim.contextFactory.call(this); }
public void init(ContextFactory factory) { factory.call(new ContextAction() { public Object run(Context cx) { init(cx); return null; } }); }
/** * Performs the action given by {@link #type} with the attached * {@link ContextFactory}. */ private void withContext() { dim.contextFactory.call(this); }
/** * To be used by <code>WindowWrapper</code>. */ void callHandler(final Function handler, final ArgumentsBuilder ab) { contextFactory.call(new ContextAction() { public Object run(Context cx) { Object[] args = ab.buildArguments(); handler.call(cx, handler.getParentScope(), globalObject, args); return null; } }); }
/** * To be used by <code>EventTargetWrapper</code>. */ Object call(ContextAction action) { return contextFactory.call(action); }
/** * To be used by <code>WindowWrapper</code>. */ void callHandler(final Function handler, final ArgumentsBuilder ab) { contextFactory.call(new ContextAction() { public Object run(Context cx) { Object[] args = ab.buildArguments(); handler.call(cx, handler.getParentScope(), globalObject, args); return null; } }); }
/** * To be used by <code>WindowWrapper</code>. */ void callHandler(final Function handler, final Object[] args) { contextFactory.call(new ContextAction() { public Object run(Context cx) { handler.call(cx, globalObject, globalObject, args); return null; } }); }
/** * To be used by <code>EventTargetWrapper</code>. */ void callHandler(final Function handler, final Object arg) { contextFactory.call(new ContextAction() { public Object run(Context cx) { Object a = Context.toObject(arg, globalObject); Object[] args = { a }; handler.call(cx, globalObject, globalObject, args); return null; } }); }
@SuppressWarnings("unchecked") public static final <T> T callInContext(ContextFactory factory, Function<Context, T> f) { return (T) factory.call((Context cx) -> { return f.apply(cx); }); }
public static Scriptable runScript(final Script script) { return (Scriptable)ContextFactory.getGlobal().call( new ContextAction() { public Object run(Context cx) { ScriptableObject global = ScriptRuntime.getGlobal(cx); script.exec(cx, global); return global; } }); }
public static Scriptable runScript(final Script script) { return (Scriptable)ContextFactory.getGlobal().call( new ContextAction() { public Object run(Context cx) { ScriptableObject global = ScriptRuntime.getGlobal(cx); script.exec(cx, global); return global; } }); }
public static Scriptable runScript(final Script script) { return (Scriptable)ContextFactory.getGlobal().call( new ContextAction() { public Object run(Context cx) { ScriptableObject global = ScriptRuntime.getGlobal(cx); script.exec(cx, global); return global; } }); }
public static Scriptable runScript(final Script script) { return (Scriptable)ContextFactory.getGlobal().call( new ContextAction() { public Object run(Context cx) { ScriptableObject global = ScriptRuntime.getGlobal(cx); script.exec(cx, global); return global; } }); }
public static Scriptable runScript(final Script script) { return (Scriptable)ContextFactory.getGlobal().call( new ContextAction() { public Object run(Context cx) { ScriptableObject global = ScriptRuntime.getGlobal(cx); script.exec(cx, global); return global; } }); }