aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
-rw-r--r--src/qml/jsruntime/qv4function.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index ced169407a..7283565489 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -136,6 +136,8 @@ Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit,
JSTypedFunction *synthesized = new JSTypedFunction;
+ QQmlTypeLoader *typeLoader = engine->typeLoader();
+
auto findQmlType = [&](const CompiledData::ParameterType &param) {
const quint32 type = param.typeNameIndexOrCommonType();
if (param.indexIsCommonType()) {
@@ -146,8 +148,11 @@ Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit,
if (type == 0)
return QQmlType();
- const QQmlType qmltype = unit->typeNameCache->query<QQmlImport::AllowRecursion>(
- unit->stringAt(type)).type;
+ const QQmlType qmltype = typeLoader
+ ? unit->typeNameCache->query<QQmlImport::AllowRecursion>(
+ unit->stringAt(type), typeLoader).type
+ : QQmlType();
+
if (!qmltype.isValid() || qmltype.typeId().isValid())
return qmltype;