public static object SearchDefaultNamespace(Context cx)
{
Scriptable scope = cx.currentActivationCall;
if (scope == null)
{
scope = GetTopCallScope(cx);
}
object nsObject;
for (; ; )
{
Scriptable parent = scope.GetParentScope();
if (parent == null)
{
nsObject = ScriptableObject.GetProperty(scope, DEFAULT_NS_TAG);
if (nsObject == ScriptableConstants.NOT_FOUND)
{
return null;
}
break;
}
nsObject = scope.Get(DEFAULT_NS_TAG, scope);
if (nsObject != ScriptableConstants.NOT_FOUND)
{
break;
}
scope = parent;
}
return nsObject;
}