aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-17 22:33:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commit2d781c4ca42f50643fa37200073a2fb2644b3806 (patch)
tree9554dbea266f6fbb7820db018e39624b6c0f1353 /tests
parent21198a676128a52e892557bc434035bcd1ddfaac (diff)
Cleanup ExecutionEngine::newBuiltinFunction() usages
And change the return type to be GC safe Change-Id: I6d7513962370fea4072a3d8c6b2c6f2d1705992e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qv4debugger/tst_qv4debugger.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
index bce236f9e2..7be954d4ef 100644
--- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
@@ -82,10 +82,11 @@ public:
Q_INVOKABLE void injectFunction(const QString &functionName, TestEngine::InjectedFunction injectedFunction)
{
QV4::ExecutionEngine *v4 = v4Engine();
+ QV4::Scope scope(v4);
- QV4::String *name = v4->newString(functionName);
- QV4::Value function = QV4::Value::fromObject(v4->newBuiltinFunction(v4->rootContext, name, injectedFunction));
- v4->globalObject->put(name, function);
+ QV4::Scoped<QV4::String> name(scope, v4->newString(functionName));
+ QV4::ScopedValue function(scope, v4->newBuiltinFunction(v4->rootContext, name.getPointer(), injectedFunction));
+ v4->globalObject->put(name.getPointer(), function);
}
signals: