Rhino.ScriptRuntime.GetElemFunctionAndThis C# (CSharp) Method

GetElemFunctionAndThis() public static method

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.
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 GetElemFunctionAndThis ( object obj, object elem, Context cx ) : Callable
obj object
elem object
cx Context
return Callable
		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, index.ToString());
			}
			object value = ScriptableObject.GetProperty(thisObj, index);
			if (!(value is Callable))
			{
				throw NotFunctionError(value, elem);
			}
			StoreScriptable(cx, thisObj);
			return (Callable)value;
		}
ScriptRuntime