internal static Callable GetCallable(Scriptable thisObj) { Callable function; if (thisObj is Callable) { function = (Callable)thisObj; } else { object value = thisObj.GetDefaultValue(ScriptRuntime.FunctionClass); if (!(value is Callable)) { throw ScriptRuntime.NotFunctionError(value, thisObj); } function = (Callable)value; } return function; }
private Rhino.BaseFunction RealFunction(Scriptable thisObj, IdFunctionObject f) { object x = thisObj.GetDefaultValue(ScriptRuntime.FunctionClass); if (x is Delegator) { x = ((Delegator)x).GetDelegee(); } if (x is Rhino.BaseFunction) { return (Rhino.BaseFunction)x; } throw ScriptRuntime.TypeError1("msg.incompat.call", f.GetFunctionName()); }