public Object run(final Context cx) { callback_.call(cx, scope, scope, args); return null; } };
/** * {@inheritDoc} */ @Override public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { return wrapped_.call(cx, scope, thisObj, args); }
/** * @see net.sourceforge.htmlunit.corejs.javascript.Function#call */ public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { return ((Function)obj).call(cx,scope,thisObj,args); }
public Object run(final Context cx) { callback_.call(cx, scope, scope, args); return null; } };
public Object run(final Context cx) { callback_.call(cx, scope, scope, args); return null; } };
/** * {@inheritDoc} */ @Override public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { return wrapped_.call(cx, scope, thisObj, args); }
public Object run(Context cx) { if (f != null) return f.call(cx, scope, scope, args); else return s.exec(cx, scope); }
private Object executeEvent(final Context cx, final MessageEvent event) { final Object handler = get("onmessage", this); if (handler != null && handler instanceof Function) { final Function handlerFunction = (Function) handler; final Object[] args = {event}; handlerFunction.call(cx, this, this, args); } return null; }
/** * @see net.sourceforge.htmlunit.corejs.javascript.Function#call */ @Override public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { synchronized(thisObj instanceof Wrapper ? ((Wrapper)thisObj).unwrap() : thisObj) { return ((Function)obj).call(cx,scope,thisObj,args); } } }
private Object executeEvent(final Context cx, final MessageEvent event) { final Object handler = get("onmessage", this); if (handler != null && handler instanceof Function) { final Function handlerFunction = (Function) handler; final Object[] args = {event}; handlerFunction.call(cx, this, this, args); } return null; }
/** * {@inheritDoc} */ public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { final SimpleScriptable wrapped = getWrappedScriptable(); if (wrapped instanceof Function) { return ((Function) wrapped).call(cx, scope, thisObj, args); } throw Context.reportRuntimeError(wrapped + " is not a function."); }
/** * {@inheritDoc} */ public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { final SimpleScriptable wrapped = getWrappedScriptable(); if (wrapped instanceof Function) { return ((Function) wrapped).call(cx, scope, thisObj, args); } throw Context.reportRuntimeError(wrapped + " is not a function."); }
/** * {@inheritDoc} */ public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { final SimpleScriptable wrapped = getWrappedScriptable(); if (wrapped instanceof Function) { return ((Function) wrapped).call(cx, scope, thisObj, args); } throw Context.reportRuntimeError(wrapped + " is not a function."); }
private static Object doCall(Context cx, Scriptable scope, Scriptable thisObj, Function f, Object[] args, long argsToWrap) { // Wrap the rest of objects for (int i = 0; i != args.length; ++i) { if (0 != (argsToWrap & (1 << i))) { Object arg = args[i]; if (!(arg instanceof Scriptable)) { args[i] = cx.getWrapFactory().wrap(cx, scope, arg, null); } } } return f.call(cx, scope, thisObj, args); }
@Override public Object doRun(final Context cx) { if (ScriptRuntime.hasTopCall(cx)) { return function.call(cx, scope, thisObject, args); } return ScriptRuntime.doTopCall(function, cx, scope, thisObject, args, cx.isStrictMode()); } @Override
@Override public Object doRun(final Context cx) { if (ScriptRuntime.hasTopCall(cx)) { return function.call(cx, scope, thisObject, args); } return ScriptRuntime.doTopCall(function, cx, scope, thisObject, args, cx.isStrictMode()); } @Override
/** * {@inheritDoc} */ @Override public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) throws JavaScriptException { // the js object to which this event is attached has to be the scope final SimpleScriptable jsObj = node_.getScriptableObject(); // compile "just in time" if (realFunction_ == null) { realFunction_ = cx.compileFunction(jsObj, jsSnippet_, eventName_ + " event for " + node_ + " in " + node_.getPage().getUrl(), 0, null); realFunction_.setParentScope(jsObj); } return realFunction_.call(cx, scope, thisObj, args); }
/** * Triggers the <tt>onerror</tt> handler, if one has been set. * @param e the error that needs to be reported */ public void triggerOnError(final ScriptException e) { final Object o = jsxGet_onerror(); if (o instanceof Function) { final Function f = (Function) o; final String msg = e.getMessage(); final String url = e.getPage().getWebResponse().getRequestSettings().getUrl().toExternalForm(); final int line = e.getFailingLineNumber(); final Object[] args = new Object[] {msg, url, line}; f.call(Context.getCurrentContext(), this, this, args); } }
/** * Triggers the <tt>onerror</tt> handler, if one has been set. * @param e the error that needs to be reported */ public void triggerOnError(final ScriptException e) { final Object o = jsxGet_onerror(); if (o instanceof Function) { final Function f = (Function) o; final String msg = e.getMessage(); final String url = e.getPage().getWebResponse().getRequestSettings().getUrl().toExternalForm(); final int line = e.getFailingLineNumber(); final Object[] args = new Object[] {msg, url, line}; f.call(Context.getCurrentContext(), this, this, args); } }
/** * Triggers the <tt>onerror</tt> handler, if one has been set. * @param e the error that needs to be reported */ public void triggerOnError(final ScriptException e) { final Object o = jsxGet_onerror(); if (o instanceof Function) { final Function f = (Function) o; final String msg = e.getMessage(); final String url = e.getPage().getWebResponse().getRequestSettings().getUrl().toExternalForm(); final int line = e.getFailingLineNumber(); final Object[] args = new Object[] {msg, url, line}; f.call(Context.getCurrentContext(), this, this, args); } }