mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 841802 - Part 1: Add ErrorResult::ClearMessage(). r=bz
This commit is contained in:
parent
685963d17c
commit
2ffa472ad4
@ -95,8 +95,16 @@ ErrorResult::ReportTypeError(JSContext* aCx)
|
||||
static_cast<const unsigned>(message->mErrorNumber),
|
||||
argCount > 0 ? args : nullptr);
|
||||
|
||||
delete message;
|
||||
mMessage = nullptr;
|
||||
ClearMessage();
|
||||
}
|
||||
|
||||
void
|
||||
ErrorResult::ClearMessage()
|
||||
{
|
||||
if (IsTypeError()) {
|
||||
delete mMessage;
|
||||
mMessage = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
namespace dom {
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
|
||||
void ThrowTypeError(const dom::ErrNum errorNumber, ...);
|
||||
void ReportTypeError(JSContext* cx);
|
||||
void ClearMessage();
|
||||
bool IsTypeError() const { return ErrorCode() == NS_ERROR_TYPE_ERR; }
|
||||
|
||||
// In the future, we can add overloads of Throw that take more
|
||||
|
Loading…
Reference in New Issue
Block a user