public static Ref CallRef(Callable function, Scriptable thisObj, object[] args, Context cx)
{
if (function is RefCallable)
{
RefCallable rfunction = (RefCallable)function;
Ref @ref = rfunction.RefCall(cx, thisObj, args);
if (@ref == null)
{
throw new InvalidOperationException(rfunction.GetType().FullName + ".refCall() returned null");
}
return @ref;
}
// No runtime support for now
string msg = GetMessage1("msg.no.ref.from.function", ToString(function));
throw ConstructError("ReferenceError", msg);
}