Bug 1289064 - eliminate null check on |iid| in XPCConvert::NativeInterface2JSObject. r?bholley
MozReview-Commit-ID: EtiVWiHlYx5
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -818,28 +818,26 @@ XPCConvert::NativeInterface2JSObject(Mut
if (!JS_WrapObject(cx, &cpow))
return false;
d.setObject(*cpow);
return true;
}
// Go ahead and create an XPCWrappedNative for this object.
AutoMarkingNativeInterfacePtr iface(cx);
- if (iid) {
- if (Interface)
- iface = *Interface;
+ if (Interface)
+ iface = *Interface;
- if (!iface) {
- iface = XPCNativeInterface::GetNewOrUsed(iid);
- if (!iface)
- return false;
+ if (!iface) {
+ iface = XPCNativeInterface::GetNewOrUsed(iid);
+ if (!iface)
+ return false;
- if (Interface)
- *Interface = iface;
- }
+ if (Interface)
+ *Interface = iface;
}
RefPtr<XPCWrappedNative> wrapper;
nsresult rv = XPCWrappedNative::GetNewOrUsed(aHelper, xpcscope, iface,
getter_AddRefs(wrapper));
if (NS_FAILED(rv) && pErr)
*pErr = rv;