Rhino.ScriptRuntime.CallRef C# (CSharp) Method

CallRef() public static method

Perform function call in reference context.
Perform function call in reference context. Should always return value that can be passed to RefGet(Ref, Context) or RefSet(Ref, object, Context) arbitrary number of times. The args array reference should not be stored in any object that is can be GC-reachable after this method returns. If this is necessary, store args.clone(), not args array itself.
public static CallRef ( Callable function, Scriptable thisObj, object args, Context cx ) : Ref
function Callable
thisObj Scriptable
args object
cx Context
return Ref
		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);
		}
ScriptRuntime