Rhino.ScriptRuntime.GetNameFunctionAndThis C# (CSharp) Method

GetNameFunctionAndThis() public static method

Prepare for calling name(...): return function corresponding to name and make current top scope available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj.
Prepare for calling name(...): return function corresponding to name and make current top scope available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method.
public static GetNameFunctionAndThis ( string name, Context cx, Scriptable scope ) : Callable
name string
cx Context
scope Scriptable
return Callable
		public static Callable GetNameFunctionAndThis(string name, Context cx, Scriptable scope)
		{
			Scriptable parent = scope.GetParentScope();
			if (parent == null)
			{
				object result = TopScopeName(cx, scope, name);
				if (!(result is Callable))
				{
					if (result == ScriptableConstants.NOT_FOUND)
					{
						throw NotFoundError(scope, name);
					}
					else
					{
						throw NotFunctionError(result, name);
					}
				}
				// Top scope is not NativeWith or NativeCall => thisObj == scope
				Scriptable thisObj = scope;
				StoreScriptable(cx, thisObj);
				return (Callable)result;
			}
			// name will call storeScriptable(cx, thisObj);
			return (Callable)NameOrFunction(cx, scope, parent, name, true);
		}
ScriptRuntime