InterfacesScriptable::FillCache(JSContext *cx, JSObject *obj,
nsXPCInterfaces::FillCache(JSContext *cx, JSObject *obj,
InterfacesScriptable::FillCache(JSContext *cx, JSObject *obj,                                nsIXPConnectWrappedNative *wrapper,                                nsIXPCScriptable *arbitrary){    nsIInterfaceInfoManager*  iim = nsnull;    nsIEnumerator*            Interfaces = nsnull;    nsISupports*              is_Interface;    nsIInterfaceInfo*         Interface;    nsresult                  rv;    if(!(iim = XPTI_GetInterfaceInfoManager()))    {        NS_ASSERTION(0,"failed to get the InterfaceInfoManager");        goto done;    }    if(NS_FAILED(iim->EnumerateInterfaces(&Interfaces)))    {        NS_ASSERTION(0,"failed to get interface enumeration");        goto done;    }    if(NS_FAILED(rv = Interfaces->First()))    {        NS_ASSERTION(0,"failed to go to first item in interface enumeration");        goto done;    }    do    {        if(NS_FAILED(rv = Interfaces->CurrentItem(&is_Interface)))        {            /* maybe something should be done,             * debugging info at least? */            Interfaces->Next();            continue;        }        rv = is_Interface->            QueryInterface(nsCOMTypeInfo<nsIInterfaceInfo>::GetIID(),                           (void **)&Interface);        if(!NS_FAILED(rv))        {            char *interface_name;            Interface->GetName(&interface_name);            RealizeInterface(cx, obj, interface_name, wrapper, arbitrary);            nsAllocator::Free(interface_name);            NS_RELEASE(Interface);        }        else        {            /* that would be odd */        }        NS_RELEASE(is_Interface);        Interfaces->Next();    } while (!NS_FAILED(Interfaces->IsDone()));done:    if(Interfaces)        NS_RELEASE(Interfaces);    if(iim)        NS_RELEASE(iim);}