diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qv4debugger/tst_qv4debugger.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp index 2532f73466..313f5893e1 100644 --- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp @@ -96,6 +96,23 @@ signals: void evaluateFinished(); }; +class ExceptionCollectJob: public CollectJob +{ + QV4DataCollector::Ref exception; + +public: + ExceptionCollectJob(QV4DataCollector *collector) : + CollectJob(collector), exception(-1) {} + + void run() { + QV4::Scope scope(collector->engine()); + QV4::ScopedValue v(scope, *collector->engine()->exceptionValue); + exception = collector->collect(v); + } + + QV4DataCollector::Ref exceptionValue() const { return exception; } +}; + class TestAgent : public QObject { Q_OBJECT @@ -174,7 +191,7 @@ public slots: if (debugger->state() == V4Debugger::Paused && debugger->engine()->hasException) { - ExceptionCollectJob job(debugger->engine(), &collector); + ExceptionCollectJob job(&collector); debugger->runInEngine(&job); m_thrownValue = job.exceptionValue(); } |