summaryrefslogtreecommitdiff
path: root/dom/base/ScriptSettings.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/ScriptSettings.h')
-rw-r--r--dom/base/ScriptSettings.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/dom/base/ScriptSettings.h b/dom/base/ScriptSettings.h
index f74d434c1..a9c1084cc 100644
--- a/dom/base/ScriptSettings.h
+++ b/dom/base/ScriptSettings.h
@@ -273,6 +273,9 @@ public:
// while keeping the old behavior as the default.
void TakeOwnershipOfErrorReporting();
bool OwnsErrorReporting() { return mOwnErrorReporting; }
+ // If HasException, report it. Otherwise, a no-op. This must be
+ // called only if OwnsErrorReporting().
+ void ReportException();
bool HasException() const {
MOZ_ASSERT(CxPusherIsStackTop());
@@ -287,6 +290,14 @@ public:
// into the current compartment.
bool StealException(JS::MutableHandle<JS::Value> aVal);
+ // Peek the current exception from the JS engine, without stealing it.
+ // Callers must ensure that HasException() is true, and that cx() is in a
+ // non-null compartment.
+ //
+ // Note that this fails if and only if we OOM while wrapping the exception
+ // into the current compartment.
+ bool PeekException(JS::MutableHandle<JS::Value> aVal);
+
void ClearException() {
MOZ_ASSERT(CxPusherIsStackTop());
JS_ClearPendingException(cx());