Rhino.ScriptRuntime.CheckDynamicScope C# (CSharp) Method

CheckDynamicScope() static private method

Return possibleDynamicScope if staticTopScope is present on its prototype chain and return staticTopScope otherwise.
Return possibleDynamicScope if staticTopScope is present on its prototype chain and return staticTopScope otherwise. Should only be called when staticTopScope is top scope.
static private CheckDynamicScope ( Scriptable possibleDynamicScope, Scriptable staticTopScope ) : Scriptable
possibleDynamicScope Scriptable
staticTopScope Scriptable
return Scriptable
		internal static Scriptable CheckDynamicScope(Scriptable possibleDynamicScope, Scriptable staticTopScope)
		{
			// Return cx.topCallScope if scope
			if (possibleDynamicScope == staticTopScope)
			{
				return possibleDynamicScope;
			}
			Scriptable proto = possibleDynamicScope;
			for (; ; )
			{
				proto = proto.GetPrototype();
				if (proto == staticTopScope)
				{
					return possibleDynamicScope;
				}
				if (proto == null)
				{
					return staticTopScope;
				}
			}
		}
ScriptRuntime