mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
1283712 - Part 2: Add JSEXN_NOTE.
This commit is contained in:
parent
6072c7290b
commit
98ebeef711
3 changed files with 5 additions and 2 deletions
|
|
@ -654,6 +654,7 @@ typedef enum JSExnType {
|
|||
JSEXN_WASMRUNTIMEERROR,
|
||||
JSEXN_ERROR_LIMIT,
|
||||
JSEXN_WARN = JSEXN_ERROR_LIMIT,
|
||||
JSEXN_NOTE,
|
||||
JSEXN_LIMIT
|
||||
} JSExnType;
|
||||
|
||||
|
|
|
|||
|
|
@ -645,6 +645,7 @@ js::ErrorToException(JSContext* cx, JSErrorReport* reportp,
|
|||
const JSErrorFormatString* errorString = callback(userRef, errorNumber);
|
||||
JSExnType exnType = errorString ? static_cast<JSExnType>(errorString->exnType) : JSEXN_ERR;
|
||||
MOZ_ASSERT(exnType < JSEXN_LIMIT);
|
||||
MOZ_ASSERT(exnType != JSEXN_NOTE);
|
||||
|
||||
if (exnType == JSEXN_WARN) {
|
||||
// werror must be enabled, so we use JSEXN_ERR.
|
||||
|
|
@ -728,7 +729,7 @@ ErrorReportToString(JSContext* cx, JSErrorReport* reportp)
|
|||
*/
|
||||
JSExnType type = static_cast<JSExnType>(reportp->exnType);
|
||||
RootedString str(cx);
|
||||
if (type != JSEXN_WARN)
|
||||
if (type != JSEXN_WARN && type != JSEXN_NOTE)
|
||||
str = ClassName(GetExceptionProtoKey(type), cx);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ static_assert(JSEXN_ERR == 0 &&
|
|||
JSProto_Error + JSEXN_WASMCOMPILEERROR == JSProto_CompileError &&
|
||||
JSProto_Error + JSEXN_WASMRUNTIMEERROR == JSProto_RuntimeError &&
|
||||
JSEXN_WASMRUNTIMEERROR + 1 == JSEXN_WARN &&
|
||||
JSEXN_WARN + 1 == JSEXN_LIMIT,
|
||||
JSEXN_WARN + 1 == JSEXN_NOTE &&
|
||||
JSEXN_NOTE + 1 == JSEXN_LIMIT,
|
||||
"GetExceptionProtoKey and ExnTypeFromProtoKey require that "
|
||||
"each corresponding JSExnType and JSProtoKey value be separated "
|
||||
"by the same constant value");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue