InterfacesScriptable::CacheDynaProp(JSContext *cx, JSObject *obj, jsid id,
nsXPCInterfaces::CacheDynaProp(JSContext *cx, JSObject *obj, jsid id,
InterfacesScriptable::CacheDynaProp(JSContext *cx, JSObject *obj, jsid id,                                    nsIXPConnectWrappedNative* wrapper,                                    nsIXPCScriptable* arbitrary){    jsval idval;    const char* property_name = NULL;    if(JS_IdToValue(cx, id, &idval) && JSVAL_IS_STRING(idval) &&       (property_name = JS_GetStringBytes(JSVAL_TO_STRING(idval))) != NULL &&       property_name[0] != '{') // we only allow interfaces by name here    {        nsJSIID* nsid = nsJSIID::NewID(property_name);        nsIXPConnectWrappedNative* nsid_wrapper;        if(nsid)        {            nsXPConnect* xpc = nsXPConnect::GetXPConnect();            if(xpc)            {                if(NS_SUCCEEDED(xpc->WrapNative(cx, nsid,                                                nsIJSIID::GetIID(),                                                &nsid_wrapper)))                {                    JSObject* idobj;                    if(NS_SUCCEEDED(nsid_wrapper->GetJSObject(&idobj)))                    {                        JSBool retval;                        jsval val = OBJECT_TO_JSVAL(idobj);                        arbitrary->SetProperty(cx, obj, id, &val, wrapper,                                               NULL, &retval);                    }                    NS_RELEASE(nsid_wrapper);                }                else                {                    NS_RELEASE(nsid);                }                NS_RELEASE(xpc);            }        }    }}