Bug 1174954 part 3. Remove ReportJSExceptionFromJSImplementation, since it no longer does anything interesting. r=bholley

This commit is contained in:
Boris Zbarsky 2015-06-16 16:44:11 -04:00
Родитель d8e0256e6d
Коммит fefbd0cfd7
4 изменённых файлов: 5 добавлений и 27 удалений

Просмотреть файл

@ -276,16 +276,6 @@ ErrorResult::ReportJSException(JSContext* cx)
mResult = NS_ERROR_FAILURE;
}
void
ErrorResult::ReportJSExceptionFromJSImplementation(JSContext* aCx)
{
MOZ_ASSERT(!mMightHaveUnreportedJSException,
"Why didn't you tell us you planned to handle JS exceptions?");
// Just report it.
ReportJSException(aCx);
}
void
ErrorResult::StealJSException(JSContext* cx,
JS::MutableHandle<JS::Value> value)

Просмотреть файл

@ -101,8 +101,7 @@ ThrowInvalidThis(JSContext* aCx, const JS::CallArgs& aArgs,
inline bool
ThrowMethodFailedWithDetails(JSContext* cx, ErrorResult& rv,
const char* ifaceName,
const char* memberName,
bool reportJSContentExceptions = false)
const char* memberName)
{
if (rv.IsUncatchableException()) {
// Nuke any existing exception on aCx, to make sure we're uncatchable.
@ -116,11 +115,7 @@ ThrowMethodFailedWithDetails(JSContext* cx, ErrorResult& rv,
return false;
}
if (rv.IsJSException()) {
if (reportJSContentExceptions) {
rv.ReportJSExceptionFromJSImplementation(cx);
} else {
rv.ReportJSException(cx);
}
rv.ReportJSException(cx);
return false;
}
if (rv.IsNotEnoughArgsError()) {

Просмотреть файл

@ -6928,13 +6928,9 @@ class CGPerSignatureCall(CGThing):
return wrapCode
def getErrorReport(self):
jsImplemented = ""
if self.descriptor.interface.isJSImplemented():
jsImplemented = ", true"
return CGGeneric('return ThrowMethodFailedWithDetails(cx, rv, "%s", "%s"%s);\n'
return CGGeneric('return ThrowMethodFailedWithDetails(cx, rv, "%s", "%s");\n'
% (self.descriptor.interface.identifier.name,
self.idlNode.identifier.name,
jsImplemented))
self.idlNode.identifier.name))
def define(self):
return (self.cgRoot.define() + self.wrap_return_value())

Просмотреть файл

@ -99,7 +99,7 @@ public:
// Facilities for throwing a preexisting JS exception value via this
// ErrorResult. The contract is that any code which might end up calling
// ThrowJSException() must call MightThrowJSException() even if no exception
// is being thrown. Code that would call ReportJSException* or
// is being thrown. Code that would call ReportJSException or
// StealJSException as needed must first call WouldReportJSException even if
// this ErrorResult has not failed.
//
@ -108,9 +108,6 @@ public:
// will wrap it into whatever compartment they're working in, as needed.
void ThrowJSException(JSContext* cx, JS::Handle<JS::Value> exn);
void ReportJSException(JSContext* cx);
// Used to implement throwing exceptions from the JS implementation of
// bindings to callers of the binding.
void ReportJSExceptionFromJSImplementation(JSContext* aCx);
bool IsJSException() const { return ErrorCode() == NS_ERROR_DOM_JS_EXCEPTION; }
void ThrowNotEnoughArgsError() { mResult = NS_ERROR_XPC_NOT_ENOUGH_ARGS; }