mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1622562 - Cleanup exnType initialization r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D67140 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
505dd78fef
commit
4c087e6905
@ -297,14 +297,6 @@ class MOZ_RAII AutoMessageArgs {
|
||||
}
|
||||
};
|
||||
|
||||
static void SetExnType(JSErrorReport* reportp, int16_t exnType) {
|
||||
reportp->exnType = exnType;
|
||||
}
|
||||
|
||||
static void SetExnType(JSErrorNotes::Note* notep, int16_t exnType) {
|
||||
// Do nothing for JSErrorNotes::Note.
|
||||
}
|
||||
|
||||
/*
|
||||
* The arguments from ap need to be packaged up into an array and stored
|
||||
* into the report struct.
|
||||
@ -339,7 +331,11 @@ static bool ExpandErrorArgumentsHelper(JSContext* cx, JSErrorCallback callback,
|
||||
}
|
||||
|
||||
if (efs) {
|
||||
SetExnType(reportp, efs->exnType);
|
||||
if constexpr (std::is_same<T, JSErrorReport>::value) {
|
||||
reportp->exnType = efs->exnType;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(reportp->errorNumber == errorNumber);
|
||||
reportp->errorMessageName = efs->name;
|
||||
|
||||
MOZ_ASSERT_IF(argumentsType == ArgumentsAreASCII,
|
||||
|
@ -639,6 +639,7 @@ static void ReportDataCloneError(JSContext* cx,
|
||||
MOZ_RELEASE_ASSERT(!cx->isExceptionPending());
|
||||
|
||||
JSErrorReport report;
|
||||
report.errorNumber = errorNumber;
|
||||
// Get js error message if it's possible and propagate it through callback.
|
||||
if (JS_ExpandErrorArgumentsASCII(cx, GetErrorMessage, errorNumber, &report,
|
||||
std::forward<Args>(aArgs)...) &&
|
||||
|
Loading…
Reference in New Issue
Block a user