summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-09 13:32:19 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:31 -0400
commitc185c2fe7230c30b3da9bf1b943a6efe3ad4f55c (patch)
tree8609ddc792802bb65dcf24ac814cc60cc1c1f500
parent3765f057896718bfca3056728a485448bfb411cb (diff)
downloadUXP-c185c2fe7230c30b3da9bf1b943a6efe3ad4f55c.tar
UXP-c185c2fe7230c30b3da9bf1b943a6efe3ad4f55c.tar.gz
UXP-c185c2fe7230c30b3da9bf1b943a6efe3ad4f55c.tar.lz
UXP-c185c2fe7230c30b3da9bf1b943a6efe3ad4f55c.tar.xz
UXP-c185c2fe7230c30b3da9bf1b943a6efe3ad4f55c.zip
1283712 - Part 2: Add JSEXN_NOTE.
-rw-r--r--js/src/jsapi.h1
-rw-r--r--js/src/jsexn.cpp3
-rw-r--r--js/src/jsexn.h3
3 files changed, 5 insertions, 2 deletions
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index d00562588..67b3d4267 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -654,6 +654,7 @@ typedef enum JSExnType {
JSEXN_WASMRUNTIMEERROR,
JSEXN_ERROR_LIMIT,
JSEXN_WARN = JSEXN_ERROR_LIMIT,
+ JSEXN_NOTE,
JSEXN_LIMIT
} JSExnType;
diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp
index b07d118b9..65cc81a1a 100644
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -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);
/*
diff --git a/js/src/jsexn.h b/js/src/jsexn.h
index 1698bb2e9..00120d89c 100644
--- a/js/src/jsexn.h
+++ b/js/src/jsexn.h
@@ -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");