зеркало из https://github.com/mozilla/gecko-dev.git
fix bug 132713. Use the iid for nsIException to detect exceptions rather than nsIXPCException. This allows for better error reporting of natively implemented exceptions. r=dbradley sr=jst a=scc.
This commit is contained in:
Родитель
3bfb435f1f
Коммит
6ce09c1621
|
@ -1078,7 +1078,7 @@ nsXPCComponents_Exception::HasInstance(nsIXPConnectWrappedNative *wrapper,
|
|||
PRBool *_retval)
|
||||
{
|
||||
if(bp)
|
||||
*bp = JSValIsInterfaceOfType(cx, val, NS_GET_IID(nsIXPCException));
|
||||
*bp = JSValIsInterfaceOfType(cx, val, NS_GET_IID(nsIException));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1211,11 +1211,11 @@ XPCConvert::JSValToXPCException(XPCCallContext& ccx,
|
|||
XPCWrappedNative::GetWrappedNativeOfJSObject(cx,obj)))
|
||||
{
|
||||
nsISupports* supports = wrapper->GetIdentityObject();
|
||||
nsCOMPtr<nsIXPCException> iface = do_QueryInterface(supports);
|
||||
nsCOMPtr<nsIException> iface = do_QueryInterface(supports);
|
||||
if(iface)
|
||||
{
|
||||
// just pass through the exception (with extra ref and all)
|
||||
nsIXPCException* temp = iface;
|
||||
nsIException* temp = iface;
|
||||
NS_ADDREF(temp);
|
||||
*exceptn = temp;
|
||||
return NS_OK;
|
||||
|
@ -1262,11 +1262,11 @@ XPCConvert::JSValToXPCException(XPCCallContext& ccx,
|
|||
nsXPCWrappedJS* jswrapper;
|
||||
nsresult rv =
|
||||
nsXPCWrappedJS::GetNewOrUsed(ccx, obj,
|
||||
NS_GET_IID(nsIXPCException),
|
||||
NS_GET_IID(nsIException),
|
||||
nsnull, &jswrapper);
|
||||
if(NS_FAILED(rv))
|
||||
return rv;
|
||||
*exceptn = NS_REINTERPRET_CAST(nsIXPCException*,
|
||||
*exceptn = NS_REINTERPRET_CAST(nsIException*,
|
||||
jswrapper);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче