aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r--src/qml/jsruntime/qv4engine_p.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 5da556452e..e49b6a4ebf 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -326,11 +326,9 @@ struct Q_QML_EXPORT ExecutionEngine
StackTrace exceptionStackTrace;
void Q_NORETURN throwException(const ValueRef value);
- void Q_NORETURN rethrowException(ExecutionContext *intermediateCatchingContext);
ReturnedValue catchException(ExecutionContext *catchingContext, StackTrace *trace);
void Q_NORETURN throwInternal();
- void Q_NORETURN rethrowInternal();
// ----
@@ -351,6 +349,23 @@ inline ExecutionContext *ExecutionEngine::popContext()
return current;
}
+struct ExecutionContextSaver
+{
+ ExecutionEngine *engine;
+ ExecutionContext *savedContext;
+
+ ExecutionContextSaver(ExecutionContext *context)
+ : engine(context->engine)
+ , savedContext(context)
+ {
+ }
+ ~ExecutionContextSaver()
+ {
+ while (engine->current != savedContext)
+ engine->popContext();
+ }
+};
+
} // namespace QV4
QT_END_NAMESPACE