aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp11
-rw-r--r--src/qml/types/qquickworkerscript.cpp12
2 files changed, 11 insertions, 12 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 9620df6af9..a1e3fde1b6 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -96,17 +96,16 @@ struct DelegateModelGroupFunction : QV4::FunctionObject
return scope->engine()->memoryManager->allocObject<DelegateModelGroupFunction>(scope, flag, code);
}
- static void call(const QV4::Managed *that, QV4::Scope &scope, QV4::CallData *callData)
+ static ReturnedValue call(const QV4::Managed *that, QV4::CallData *callData)
{
+ QV4::Scope scope(that->engine());
QV4::Scoped<DelegateModelGroupFunction> f(scope, static_cast<const DelegateModelGroupFunction *>(that));
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject);
- if (!o) {
- scope.result = scope.engine->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- return;
- }
+ if (!o)
+ return scope.engine->throwTypeError(QStringLiteral("Not a valid VisualData object"));
QV4::ScopedValue v(scope, callData->argument(0));
- scope.result = f->d()->code(o->d()->item, f->d()->flag, v);
+ return f->d()->code(o->d()->item, f->d()->flag, v);
}
};
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index 6b7e3dee9f..743bcbc5a3 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -250,8 +250,7 @@ void QQuickWorkerScriptEnginePrivate::WorkerEngine::init()
QV4::ScopedCallData callData(scope, 1);
callData->args[0] = function;
callData->thisObject = global();
- createsendconstructor->call(scope, callData);
- createsend.set(scope.engine, scope.result.asReturnedValue());
+ createsend.set(scope.engine, createsendconstructor->call(callData));
}
// Requires handle and context scope
@@ -264,13 +263,14 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::WorkerEngine::sendFunction(i
QV4::Scope scope(v4);
QV4::ScopedFunctionObject f(scope, createsend.value());
+ QV4::ScopedValue v(scope);
QV4::ScopedCallData callData(scope, 1);
callData->args[0] = QV4::Primitive::fromInt32(id);
callData->thisObject = global();
- f->call(scope, callData);
+ v = f->call(callData);
if (scope.hasException())
- scope.result = scope.engine->catchException();
- return scope.result.asReturnedValue();
+ v = scope.engine->catchException();
+ return v->asReturnedValue();
}
#if QT_CONFIG(qml_network)
@@ -367,7 +367,7 @@ void QQuickWorkerScriptEnginePrivate::processMessage(int id, const QByteArray &d
callData->thisObject = workerEngine->global();
callData->args[0] = qmlContext->d()->qml(); // ###
callData->args[1] = value;
- f->call(scope, callData);
+ f->call(callData);
if (scope.hasException()) {
QQmlError error = scope.engine->catchExceptionAsQmlError();
reportScriptException(script, error);