зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1180851. Don't make ThrowMethodFailed an inline function, because there's no really good reason to and we might as well save the codesize. r=peterv
This commit is contained in:
Родитель
d39d28be5c
Коммит
8d3a6f26dd
|
@ -108,6 +108,28 @@ ThrowInvalidThis(JSContext* aCx, const JS::CallArgs& aArgs,
|
|||
NamesOfInterfacesWithProtos(aProtoId));
|
||||
}
|
||||
|
||||
bool
|
||||
ThrowMethodFailed(JSContext* cx, ErrorResult& rv)
|
||||
{
|
||||
if (rv.IsUncatchableException()) {
|
||||
// Nuke any existing exception on aCx, to make sure we're uncatchable.
|
||||
JS_ClearPendingException(cx);
|
||||
// Don't do any reporting. Just return false, to create an
|
||||
// uncatchable exception.
|
||||
return false;
|
||||
}
|
||||
if (rv.IsErrorWithMessage()) {
|
||||
rv.ReportErrorWithMessage(cx);
|
||||
return false;
|
||||
}
|
||||
if (rv.IsJSException()) {
|
||||
rv.ReportJSException(cx);
|
||||
return false;
|
||||
}
|
||||
rv.ReportGenericError(cx);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
ThrowNoSetterArg(JSContext* aCx, prototypes::ID aProtoId)
|
||||
{
|
||||
|
|
|
@ -89,27 +89,8 @@ ThrowInvalidThis(JSContext* aCx, const JS::CallArgs& aArgs,
|
|||
const ErrNum aErrorNumber,
|
||||
prototypes::ID aProtoId);
|
||||
|
||||
inline bool
|
||||
ThrowMethodFailed(JSContext* cx, ErrorResult& rv)
|
||||
{
|
||||
if (rv.IsUncatchableException()) {
|
||||
// Nuke any existing exception on aCx, to make sure we're uncatchable.
|
||||
JS_ClearPendingException(cx);
|
||||
// Don't do any reporting. Just return false, to create an
|
||||
// uncatchable exception.
|
||||
return false;
|
||||
}
|
||||
if (rv.IsErrorWithMessage()) {
|
||||
rv.ReportErrorWithMessage(cx);
|
||||
return false;
|
||||
}
|
||||
if (rv.IsJSException()) {
|
||||
rv.ReportJSException(cx);
|
||||
return false;
|
||||
}
|
||||
rv.ReportGenericError(cx);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
ThrowMethodFailed(JSContext* cx, ErrorResult& rv);
|
||||
|
||||
// Returns true if the JSClass is used for DOM objects.
|
||||
inline bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче