/** * @deprecated The method is only present for compatibility. */ @Deprecated public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) { if (!(fun instanceof Function)) { throw notFunctionError(toString(fun)); } Function function = (Function)fun; Scriptable thisObj = toObjectOrNull(cx, thisArg, scope); if (thisObj == null) { throw undefCallError(thisObj, "function"); } return function.call(cx, scope, thisObj, args); }
/** * @deprecated The method is only present for compatibility. */ public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) { if (!(fun instanceof Function)) { throw notFunctionError(toString(fun)); } Function function = (Function)fun; Scriptable thisObj = toObjectOrNull(cx, thisArg); if (thisObj == null) { throw undefCallError(thisObj, "function"); } return function.call(cx, scope, thisObj, args); }
/** * @deprecated The method is only present for compatibility. */ public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) { if (!(fun instanceof Function)) { throw notFunctionError(toString(fun)); } Function function = (Function)fun; Scriptable thisObj = toObjectOrNull(cx, thisArg); if (thisObj == null) { throw undefCallError(thisObj, "function"); } return function.call(cx, scope, thisObj, args); }
/** * @deprecated The method is only present for compatibility. */ public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) { if (!(fun instanceof Function)) { throw notFunctionError(toString(fun)); } Function function = (Function)fun; Scriptable thisObj = toObjectOrNull(cx, thisArg); if (thisObj == null) { throw undefCallError(thisObj, "function"); } return function.call(cx, scope, thisObj, args); }
/** * @deprecated The method is only present for compatibility. */ public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) { if (!(fun instanceof Function)) { throw notFunctionError(toString(fun)); } Function function = (Function)fun; Scriptable thisObj = toObjectOrNull(cx, thisArg); if (thisObj == null) { throw undefCallError(thisObj, "function"); } return function.call(cx, scope, thisObj, args); }
/** * @deprecated The method is only present for compatibility. */ public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) { if (!(fun instanceof Function)) { throw notFunctionError(toString(fun)); } Function function = (Function)fun; Scriptable thisObj = toObjectOrNull(cx, thisArg); if (thisObj == null) { throw undefCallError(thisObj, "function"); } return function.call(cx, scope, thisObj, args); }
private static Callable getPropFunctionAndThisHelper(Object obj, String property, Context cx, Scriptable thisObj) { if (thisObj == null) { throw undefCallError(obj, property); } Object value = ScriptableObject.getProperty(thisObj, property); if (!(value instanceof Callable)) { Object noSuchMethod = ScriptableObject.getProperty(thisObj, "__noSuchMethod__"); if (noSuchMethod instanceof Callable) value = new NoSuchMethodShim((Callable)noSuchMethod, property); } if (!(value instanceof Callable)) { throw notFunctionError(thisObj, value, property); } storeScriptable(cx, thisObj); return (Callable)value; }
private static Callable getPropFunctionAndThisHelper(Object obj, String property, Context cx, Scriptable thisObj) { if (thisObj == null) { throw undefCallError(obj, property); } Object value = ScriptableObject.getProperty(thisObj, property); if (!(value instanceof Callable)) { Object noSuchMethod = ScriptableObject.getProperty(thisObj, "__noSuchMethod__"); if (noSuchMethod instanceof Callable) value = new NoSuchMethodShim((Callable)noSuchMethod, property); } if (!(value instanceof Callable)) { throw notFunctionError(thisObj, value, property); } storeScriptable(cx, thisObj); return (Callable)value; }
private static Callable getPropFunctionAndThisHelper(Object obj, String property, Context cx, Scriptable thisObj) { if (thisObj == null) { throw undefCallError(obj, property); } Object value = ScriptableObject.getProperty(thisObj, property); if (!(value instanceof Callable)) { Object noSuchMethod = ScriptableObject.getProperty(thisObj, "__noSuchMethod__"); if (noSuchMethod instanceof Callable) value = new NoSuchMethodShim((Callable)noSuchMethod, property); } if (!(value instanceof Callable)) { throw notFunctionError(thisObj, value, property); } storeScriptable(cx, thisObj); return (Callable)value; }
private static Callable getPropFunctionAndThisHelper(Object obj, String property, Context cx, Scriptable thisObj) { if (thisObj == null) { throw undefCallError(obj, property); } Object value = ScriptableObject.getProperty(thisObj, property); if (!(value instanceof Callable)) { Object noSuchMethod = ScriptableObject.getProperty(thisObj, "__noSuchMethod__"); if (noSuchMethod instanceof Callable) value = new NoSuchMethodShim((Callable)noSuchMethod, property); } if (!(value instanceof Callable)) { throw notFunctionError(thisObj, value, property); } storeScriptable(cx, thisObj); return (Callable)value; }
/** * Prepare for calling obj[id](...): return function corresponding to * obj[id] and make obj properly converted to Scriptable available * as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. * The caller must call ScriptRuntime.lastStoredScriptable() immediately * after calling this method. */ public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx) { String str = toStringIdOrIndex(cx, elem); if (str != null) { return getPropFunctionAndThis(obj, str, cx); } int index = lastIndexResult(cx); Scriptable thisObj = toObjectOrNull(cx, obj); if (thisObj == null) { throw undefCallError(obj, String.valueOf(index)); } Object value = ScriptableObject.getProperty(thisObj, index); if (!(value instanceof Callable)) { throw notFunctionError(value, elem); } storeScriptable(cx, thisObj); return (Callable)value; }
/** * Prepare for calling obj[id](...): return function corresponding to * obj[id] and make obj properly converted to Scriptable available * as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. * The caller must call ScriptRuntime.lastStoredScriptable() immediately * after calling this method. */ public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx, Scriptable scope) { String str = toStringIdOrIndex(cx, elem); if (str != null) { return getPropFunctionAndThis(obj, str, cx, scope); } int index = lastIndexResult(cx); Scriptable thisObj = toObjectOrNull(cx, obj, scope); if (thisObj == null) { throw undefCallError(obj, String.valueOf(index)); } Object value = ScriptableObject.getProperty(thisObj, index); if (!(value instanceof Callable)) { throw notFunctionError(value, elem); } storeScriptable(cx, thisObj); return (Callable)value; }
/** * Prepare for calling obj[id](...): return function corresponding to * obj[id] and make obj properly converted to Scriptable available * as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. * The caller must call ScriptRuntime.lastStoredScriptable() immediately * after calling this method. */ public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx) { String str = toStringIdOrIndex(cx, elem); if (str != null) { return getPropFunctionAndThis(obj, str, cx); } int index = lastIndexResult(cx); Scriptable thisObj = toObjectOrNull(cx, obj); if (thisObj == null) { throw undefCallError(obj, String.valueOf(index)); } Object value = ScriptableObject.getProperty(thisObj, index); if (!(value instanceof Callable)) { throw notFunctionError(value, elem); } storeScriptable(cx, thisObj); return (Callable)value; }
/** * Prepare for calling obj[id](...): return function corresponding to * obj[id] and make obj properly converted to Scriptable available * as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. * The caller must call ScriptRuntime.lastStoredScriptable() immediately * after calling this method. */ public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx) { String str = toStringIdOrIndex(cx, elem); if (str != null) { return getPropFunctionAndThis(obj, str, cx); } int index = lastIndexResult(cx); Scriptable thisObj = toObjectOrNull(cx, obj); if (thisObj == null) { throw undefCallError(obj, String.valueOf(index)); } Object value = ScriptableObject.getProperty(thisObj, index); if (!(value instanceof Callable)) { throw notFunctionError(value, elem); } storeScriptable(cx, thisObj); return (Callable)value; }
throw undefCallError(obj, property);
throw undefCallError(obj, String.valueOf(index));
throw undefCallError(obj, String.valueOf(index));
throw undefCallError(obj, property);