Bug 747245: Fix a silly weak reference assertion. r=bent a=mfinkle

This commit is contained in:
Kyle Huey 2012-04-23 14:14:10 -07:00
parent 569fa9dcee
commit 544801113f

View File

@ -60,8 +60,10 @@ nsresult xpcJSWeakReference::Init(JSContext* cx, const JS::Value& object)
// See if the object is a wrapped native that supports weak references.
nsISupports* supports =
nsXPConnect::GetXPConnect()->GetNativeOfWrapper(cx, &obj);
if (supports) {
mReferent = do_GetWeakReference(supports);
nsCOMPtr<nsISupportsWeakReference> supportsWeakRef =
do_QueryInterface(supports);
if (supportsWeakRef) {
supportsWeakRef->GetWeakReference(getter_AddRefs(mReferent));
if (mReferent) {
return NS_OK;
}