nsCOMPtr<nsIJSIID> nsid = dont_AddRef(NS_STATIC_CAST(nsIJSIID*,nsJSIID::NewID(name)));
nsCOMPtr<nsIJSCID> nsid = dont_AddRef(NS_STATIC_CAST(nsIJSCID*,nsJSCID::NewID(name)));
nsXPCComponents_Interfaces::NewResolve(nsIXPConnectWrappedNative *wrapper,                                       JSContext * cx, JSObject * obj,                                       jsval id, PRUint32 flags,                                       JSObject * *objp, PRBool *_retval){    const char* name = nsnull;    if(JSVAL_IS_STRING(id) &&       nsnull != (name = JS_GetStringBytes(JSVAL_TO_STRING(id))) &&       name[0] != '{') // we only allow interfaces by name here    {        nsCOMPtr<nsIJSIID> nsid =            dont_AddRef(NS_STATIC_CAST(nsIJSIID*,nsJSIID::NewID(name)));        if(nsid)        {            nsCOMPtr<nsIXPConnect> xpc;            wrapper->GetXPConnect(getter_AddRefs(xpc));            if(xpc)            {                nsCOMPtr<nsIXPConnectJSObjectHolder> holder;                if(NS_SUCCEEDED(xpc->WrapNative(cx, obj,                                                NS_STATIC_CAST(nsIJSIID*,nsid),                                                NS_GET_IID(nsIJSIID),                                                getter_AddRefs(holder))))                {                    JSObject* idobj;                    if(holder && NS_SUCCEEDED(holder->GetJSObject(&idobj)))                    {                        jsid idid;                        *objp = obj;                        *_retval = JS_ValueToId(cx, id, &idid) &&                                   OBJ_DEFINE_PROPERTY(cx, obj, idid,                                                       OBJECT_TO_JSVAL(idobj),                                                       nsnull, nsnull,                                                       JSPROP_ENUMERATE |                                                       JSPROP_READONLY |                                                       JSPROP_PERMANENT,                                                       nsnull);                    }                }            }        }    }    return NS_OK;}