diff options
Diffstat (limited to 'tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp')
-rw-r--r-- | tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp index 7398e97326..1b2df62b76 100644 --- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp @@ -93,6 +93,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 @@ -170,7 +187,7 @@ public slots: m_statesWhenPaused << debugger->currentExecutionState(); if (debugger->state() == QV4Debugger::Paused && debugger->engine()->hasException) { - ExceptionCollectJob job(debugger->engine(), &collector); + ExceptionCollectJob job(&collector); debugger->runInEngine(&job); m_thrownValue = job.exceptionValue(); } |