No bug - Propagate false return value from xpc_qsThrowMethodFailedWithDetails; r=bz

This commit is contained in:
Ms2ger 2012-02-07 21:31:29 +01:00
parent b5ab39ac78
commit ccee066e87
3 changed files with 6 additions and 8 deletions

View File

@ -516,7 +516,7 @@ GetMethodInfo(JSContext *cx, jsval *vp, const char **ifaceNamep, jsid *memberIdp
*memberIdp = methodId;
}
static JSBool
static bool
ThrowCallFailed(JSContext *cx, nsresult rv,
const char *ifaceName, jsid memberId, const char *memberName)
{
@ -592,12 +592,12 @@ xpc_qsThrowMethodFailedWithCcx(XPCCallContext &ccx, nsresult rv)
return false;
}
void
bool
xpc_qsThrowMethodFailedWithDetails(JSContext *cx, nsresult rv,
const char *ifaceName,
const char *memberName)
{
ThrowCallFailed(cx, rv, ifaceName, JSID_VOID, memberName);
return ThrowCallFailed(cx, rv, ifaceName, JSID_VOID, memberName);
}
static void

View File

@ -197,7 +197,7 @@ xpc_qsThrowMethodFailed(JSContext *cx, nsresult rv, jsval *vp);
JSBool
xpc_qsThrowMethodFailedWithCcx(XPCCallContext &ccx, nsresult rv);
void
bool
xpc_qsThrowMethodFailedWithDetails(JSContext *cx, nsresult rv,
const char *ifaceName,
const char *memberName);

View File

@ -580,10 +580,8 @@ def writeBindingStub(f, classname, member, stubName, isSetter=False):
" return false;\n" % classname)
return "%sWrapper::getListObject(obj)" % classname
def writeCheckForFailure(f, isMethod, isGeter, haveCcx):
f.write(" if (NS_FAILED(rv)) {\n"
" xpc_qsThrowMethodFailedWithDetails(cx, rv, \"%s\", \"%s\");\n"
" return JS_FALSE;\n"
" }\n" % (classname, member.name))
f.write(" if (NS_FAILED(rv))\n"
" return xpc_qsThrowMethodFailedWithDetails(cx, rv, \"%s\", \"%s\");\n" % (classname, member.name))
def writeResultWrapping(f, member, jsvalPtr, jsvalRef):
if member.kind == 'method' and member.notxpcom and len(member.params) > 0 and member.params[len(member.params) - 1].paramtype == 'out':
assert member.params[len(member.params) - 1].realtype.kind == 'native' and member.params[len(member.params) - 1].realtype.nativename == 'nsWrapperCache'