Bug 1180770 part 2. Remove the unused ifaceName/memberName arguments of ThrowMethodFailedWithDetails and rename it to ThrowMethodFailed. r=peterv

This commit is contained in:
Boris Zbarsky 2015-07-09 22:51:28 -04:00
parent afdc22e267
commit d39d28be5c
5 changed files with 8 additions and 12 deletions

View File

@ -2646,7 +2646,7 @@ ConvertExceptionToPromise(JSContext* cx,
if (rv.Failed()) {
// We just give up. Make sure to not leak memory on the
// ErrorResult, but then just put the original exception back.
ThrowMethodFailedWithDetails(cx, rv, "", "");
ThrowMethodFailed(cx, rv);
JS_SetPendingException(cx, exn);
return false;
}

View File

@ -90,9 +90,7 @@ ThrowInvalidThis(JSContext* aCx, const JS::CallArgs& aArgs,
prototypes::ID aProtoId);
inline bool
ThrowMethodFailedWithDetails(JSContext* cx, ErrorResult& rv,
const char* ifaceName,
const char* memberName)
ThrowMethodFailed(JSContext* cx, ErrorResult& rv)
{
if (rv.IsUncatchableException()) {
// Nuke any existing exception on aCx, to make sure we're uncatchable.

View File

@ -1709,7 +1709,7 @@ class CGConstructNavigatorObject(CGAbstractMethod):
nsRefPtr<mozilla::dom::${descriptorName}> result = ConstructNavigatorObjectHelper(aCx, global, rv);
rv.WouldReportJSException();
if (rv.Failed()) {
ThrowMethodFailedWithDetails(aCx, rv, "${descriptorName}", "navigatorConstructor");
ThrowMethodFailed(aCx, rv);
return nullptr;
}
if (!GetOrCreateDOMReflector(aCx, result, &v)) {
@ -7012,9 +7012,7 @@ class CGPerSignatureCall(CGThing):
return wrapCode
def getErrorReport(self):
return CGGeneric('return ThrowMethodFailedWithDetails(cx, rv, "%s", "%s");\n'
% (self.descriptor.interface.identifier.name,
self.idlNode.identifier.name))
return CGGeneric('return ThrowMethodFailed(cx, rv);\n')
def define(self):
return (self.cgRoot.define() + self.wrap_return_value())
@ -7969,7 +7967,7 @@ class CGEnumerateHook(CGAbstractBindingMethod):
self->GetOwnPropertyNames(cx, names, rv);
rv.WouldReportJSException();
if (rv.Failed()) {
return ThrowMethodFailedWithDetails(cx, rv, "%s", "enumerate");
return ThrowMethodFailed(cx, rv);
}
bool dummy;
for (uint32_t i = 0; i < names.Length(); ++i) {
@ -10026,7 +10024,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod):
self->GetOwnPropertyNames(cx, names, rv);
rv.WouldReportJSException();
if (rv.Failed()) {
return ThrowMethodFailedWithDetails(cx, rv, "%s", "enumerate");
return ThrowMethodFailed(cx, rv);
}
// OK to pass null as "proxy" because it's ignored if
// shadowPrototypeProperties is true

View File

@ -56,7 +56,7 @@ ToJSValue(JSContext* aCx,
MOZ_ASSERT(!aArgument.IsUncatchableException(),
"Doesn't make sense to convert uncatchable exception to a JS value!");
AutoForceSetExceptionOnContext forceExn(aCx);
DebugOnly<bool> throwResult = ThrowMethodFailedWithDetails(aCx, aArgument, "", "");
DebugOnly<bool> throwResult = ThrowMethodFailed(aCx, aArgument);
MOZ_ASSERT(!throwResult);
DebugOnly<bool> getPendingResult = JS_GetPendingException(aCx, aValue);
MOZ_ASSERT(getPendingResult);

View File

@ -291,7 +291,7 @@ SandboxFetch(JSContext* cx, JS::HandleObject scope, const CallArgs& args)
FetchRequest(global, Constify(request), Constify(options), rv);
rv.WouldReportJSException();
if (rv.Failed()) {
return ThrowMethodFailedWithDetails(cx, rv, "Sandbox", "fetch");
return ThrowMethodFailed(cx, rv);
}
if (!GetOrCreateDOMReflector(cx, scope, response, args.rval())) {
return false;