diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 13:55:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:18 +0200 |
commit | 1a2a83f80ba4ecc28eba72af57c81bd43a45946c (patch) | |
tree | c2e4eb4d9bb57873ca340f6bbbf2342b36c91452 /src/qml/types | |
parent | 826550af450b39f47a3c00ec316acf1e317f12c6 (diff) |
Use a ReturnedValue for Managed::call()
Change-Id: Ief2d75e9789dd367c603d90dc0fe5316a0d055e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 4 | ||||
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index f3a4179374..9c9a2196c7 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -81,7 +81,7 @@ struct DelegateModelGroupFunction: QV4::FunctionObject return QV4::Value::undefinedValue(); } - static QV4::Value call(QV4::Managed *that, QV4::CallData *callData) + static QV4::ReturnedValue call(QV4::Managed *that, QV4::CallData *callData) { DelegateModelGroupFunction *f = static_cast<DelegateModelGroupFunction *>(that); QQmlDelegateModelItemObject *o = callData->thisObject.as<QQmlDelegateModelItemObject>(); @@ -89,7 +89,7 @@ struct DelegateModelGroupFunction: QV4::FunctionObject that->engine()->current->throwTypeError(QStringLiteral("Not a valid VisualData object")); QV4::Value v = callData->argc ? callData->args[0] : QV4::Value::undefinedValue(); - return f->code(o->item, f->flag, v); + return f->code(o->item, f->flag, v).asReturnedValue(); } }; diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index 26514ac6db..42548e6ad6 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -244,8 +244,10 @@ void QQuickWorkerScriptEnginePrivate::WorkerEngine::init() QV4::Value QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(int id) { QV4::FunctionObject *f = createsend.value().asFunctionObject(); - QV4::Value v = QV4::Value::undefinedValue(); - QV4::ExecutionContext *ctx = f->internalClass->engine->current; + QV4::ExecutionContext *ctx = f->engine()->current; + QV4::ValueScope scope(ctx->engine); + + QV4::ScopedValue v(scope); try { QV4::ScopedCallData callData(m_v4Engine, 1); callData->args[0] = QV4::Value::fromInt32(id); @@ -346,10 +348,11 @@ void QQuickWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &d if (!script) return; - QV4::Value value = QV4::Serialize::deserialize(data, workerEngine); - QV4::FunctionObject *f = workerEngine->onmessage.value().asFunctionObject(); QV4::ExecutionContext *ctx = f->internalClass->engine->current; + QV4::ValueScope scope(ctx); + + QV4::ScopedValue value(scope, QV4::Serialize::deserialize(data, workerEngine)); try { QV4::ScopedCallData callData(ctx->engine, 2); |