summaryrefslogtreecommitdiff
path: root/js/src/jsexn.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsexn.h')
-rw-r--r--js/src/jsexn.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/src/jsexn.h b/js/src/jsexn.h
index a63c70909e..ae6335209b 100644
--- a/js/src/jsexn.h
+++ b/js/src/jsexn.h
@@ -85,10 +85,17 @@ ExnTypeFromProtoKey(JSProtoKey key)
{
JSExnType type = static_cast<JSExnType>(key - JSProto_Error);
MOZ_ASSERT(type >= JSEXN_ERR);
- MOZ_ASSERT(type < JSEXN_WARN);
+ MOZ_ASSERT(type < JSEXN_ERROR_LIMIT);
return type;
}
+static inline bool
+IsErrorProtoKey(JSProtoKey key)
+{
+ JSExnType type = static_cast<JSExnType>(key - JSProto_Error);
+ return type >= JSEXN_ERR && type < JSEXN_ERROR_LIMIT;
+}
+
class AutoClearPendingException
{
JSContext* cx;