aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compat/removed_api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/compat/removed_api.cpp')
-rw-r--r--src/qml/compat/removed_api.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/qml/compat/removed_api.cpp b/src/qml/compat/removed_api.cpp
index 4cbaab71a9..d812d36282 100644
--- a/src/qml/compat/removed_api.cpp
+++ b/src/qml/compat/removed_api.cpp
@@ -125,4 +125,28 @@ QVariant QQmlPrivate::AOTCompiledContext::constructValueType(
resultMetaType, resultMetaObject, ctorIndex, args);
}
+bool QQmlPrivate::AOTCompiledContext::callGlobalLookup(
+ uint index, void **args, const QMetaType *types, int argc) const
+{
+ QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
+ QV4::Scope scope(engine->handle());
+ QV4::ScopedFunctionObject function(scope, lookup->globalGetter(scope.engine));
+ if (!function) {
+ scope.engine->throwTypeError(
+ QStringLiteral("Property '%1' of object [null] is not a function")
+ .arg(compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
+ return false;
+ }
+
+ function->call(nullptr, args, types, argc);
+ return true;
+}
+
+void QQmlPrivate::AOTCompiledContext::initCallGlobalLookup(uint index) const
+{
+ Q_UNUSED(index);
+ Q_ASSERT(engine->hasError());
+ engine->handle()->amendException();
+}
+
#endif