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;
}
}
}