Skip to content

Commit d39d28b

Browse files
committed
Bug 1180770 part 2. Remove the unused ifaceName/memberName arguments of ThrowMethodFailedWithDetails and rename it to ThrowMethodFailed. r=peterv
1 parent afdc22e commit d39d28b

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

dom/bindings/BindingUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,7 @@ ConvertExceptionToPromise(JSContext* cx,
26462646
if (rv.Failed()) {
26472647
// We just give up. Make sure to not leak memory on the
26482648
// ErrorResult, but then just put the original exception back.
2649-
ThrowMethodFailedWithDetails(cx, rv, "", "");
2649+
ThrowMethodFailed(cx, rv);
26502650
JS_SetPendingException(cx, exn);
26512651
return false;
26522652
}

dom/bindings/BindingUtils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ ThrowInvalidThis(JSContext* aCx, const JS::CallArgs& aArgs,
9090
prototypes::ID aProtoId);
9191

9292
inline bool
93-
ThrowMethodFailedWithDetails(JSContext* cx, ErrorResult& rv,
94-
const char* ifaceName,
95-
const char* memberName)
93+
ThrowMethodFailed(JSContext* cx, ErrorResult& rv)
9694
{
9795
if (rv.IsUncatchableException()) {
9896
// Nuke any existing exception on aCx, to make sure we're uncatchable.

dom/bindings/Codegen.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ def definition_body(self):
17091709
nsRefPtr<mozilla::dom::${descriptorName}> result = ConstructNavigatorObjectHelper(aCx, global, rv);
17101710
rv.WouldReportJSException();
17111711
if (rv.Failed()) {
1712-
ThrowMethodFailedWithDetails(aCx, rv, "${descriptorName}", "navigatorConstructor");
1712+
ThrowMethodFailed(aCx, rv);
17131713
return nullptr;
17141714
}
17151715
if (!GetOrCreateDOMReflector(aCx, result, &v)) {
@@ -7012,9 +7012,7 @@ def wrap_return_value(self):
70127012
return wrapCode
70137013

70147014
def getErrorReport(self):
7015-
return CGGeneric('return ThrowMethodFailedWithDetails(cx, rv, "%s", "%s");\n'
7016-
% (self.descriptor.interface.identifier.name,
7017-
self.idlNode.identifier.name))
7015+
return CGGeneric('return ThrowMethodFailed(cx, rv);\n')
70187016

70197017
def define(self):
70207018
return (self.cgRoot.define() + self.wrap_return_value())
@@ -7969,7 +7967,7 @@ def generate_code(self):
79697967
self->GetOwnPropertyNames(cx, names, rv);
79707968
rv.WouldReportJSException();
79717969
if (rv.Failed()) {
7972-
return ThrowMethodFailedWithDetails(cx, rv, "%s", "enumerate");
7970+
return ThrowMethodFailed(cx, rv);
79737971
}
79747972
bool dummy;
79757973
for (uint32_t i = 0; i < names.Length(); ++i) {
@@ -10026,7 +10024,7 @@ def generate_code(self):
1002610024
self->GetOwnPropertyNames(cx, names, rv);
1002710025
rv.WouldReportJSException();
1002810026
if (rv.Failed()) {
10029-
return ThrowMethodFailedWithDetails(cx, rv, "%s", "enumerate");
10027+
return ThrowMethodFailed(cx, rv);
1003010028
}
1003110029
// OK to pass null as "proxy" because it's ignored if
1003210030
// shadowPrototypeProperties is true

dom/bindings/ToJSValue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ToJSValue(JSContext* aCx,
5656
MOZ_ASSERT(!aArgument.IsUncatchableException(),
5757
"Doesn't make sense to convert uncatchable exception to a JS value!");
5858
AutoForceSetExceptionOnContext forceExn(aCx);
59-
DebugOnly<bool> throwResult = ThrowMethodFailedWithDetails(aCx, aArgument, "", "");
59+
DebugOnly<bool> throwResult = ThrowMethodFailed(aCx, aArgument);
6060
MOZ_ASSERT(!throwResult);
6161
DebugOnly<bool> getPendingResult = JS_GetPendingException(aCx, aValue);
6262
MOZ_ASSERT(getPendingResult);

js/xpconnect/src/Sandbox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ SandboxFetch(JSContext* cx, JS::HandleObject scope, const CallArgs& args)
291291
FetchRequest(global, Constify(request), Constify(options), rv);
292292
rv.WouldReportJSException();
293293
if (rv.Failed()) {
294-
return ThrowMethodFailedWithDetails(cx, rv, "Sandbox", "fetch");
294+
return ThrowMethodFailed(cx, rv);
295295
}
296296
if (!GetOrCreateDOMReflector(cx, scope, response, args.rval())) {
297297
return false;

0 commit comments

Comments
 (0)