From b60a5dc9405ce89d7a742abc81b906d5c8cf5f7d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 20 Jan 2016 13:57:16 +0100 Subject: Clean up QV4DataCollector We don't need to pass debuggers and engines around as the data collector already has all the necessary information. Also, the exception collect job is only used in the test case, so we don't need to define it in the collector. Change-Id: I3197dd5c2d99e95465aa787097c6f8bf8aee794e Reviewed-by: Simon Hausmann --- tests/auto/qml/qv4debugger/tst_qv4debugger.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tests') 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(); } -- cgit v1.2.3