diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-01-05 22:21:35 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-01-25 08:31:28 +0000 |
commit | 25552c1404dff66ae9681e57f2b9a8be08d3828a (patch) | |
tree | f0f00a1e53d1eedc0ee93f32243555a4d43eeeaa /src/qml/types/qquickworkerscript.cpp | |
parent | 381e3151aea83806fb5bea2407fef67de3cc5014 (diff) |
Convert more builtin functions to the new calling convention
Change-Id: I053215261e1186aff25f29e0967219ef667f7678
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/types/qquickworkerscript.cpp')
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index 5f716da17a..f35e17c34d 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -185,7 +185,7 @@ public: int m_nextId; - static QV4::ReturnedValue method_sendMessage(QV4::CallContext *ctx); + static void method_sendMessage(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData); signals: void stopThread(); @@ -292,14 +292,13 @@ QQuickWorkerScriptEnginePrivate::QQuickWorkerScriptEnginePrivate(QQmlEngine *eng { } -QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::method_sendMessage(QV4::CallContext *ctx) +void QQuickWorkerScriptEnginePrivate::method_sendMessage(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData) { - WorkerEngine *engine = (WorkerEngine*)ctx->engine()->v8Engine; + WorkerEngine *engine = (WorkerEngine*)scope.engine->v8Engine; - int id = ctx->argc() > 1 ? ctx->args()[1].toInt32() : 0; + int id = callData->argc > 1 ? callData->args[1].toInt32() : 0; - QV4::Scope scope(ctx); - QV4::ScopedValue v(scope, ctx->argument(2)); + QV4::ScopedValue v(scope, callData->argument(2)); QByteArray data = QV4::Serialize::serialize(v, scope.engine); QMutexLocker locker(&engine->p->m_lock); @@ -307,7 +306,7 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::method_sendMessage(QV4::Call if (script && script->owner) QCoreApplication::postEvent(script->owner, new WorkerDataEvent(0, data)); - return QV4::Encode::undefined(); + scope.result = QV4::Encode::undefined(); } QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *script) |