From 1b0fc3af8f999f740d1a976a6be2bdea212ad586 Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Tue, 11 May 2021 16:31:57 +0200 Subject: qqmlirbuilder: Fix deep inline component script bindings Previously when having an inline component inside any component that was not the root component, we hit an assert when using a script bindings. This was due to us not generating script bindings for any more deeply nested components. Now they work regardless of component depth. Change-Id: I700cf918f955aa99076006d53fb20358ff06e75f Reviewed-by: Andrei Golubev Reviewed-by: Ulf Hermann --- src/qml/compiler/qqmlirbuilder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/qml/compiler') diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 10fc3f8407..e2e9d15479 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1986,8 +1986,6 @@ bool JSCodeGen::compileComponent(int contextObject) Q_ASSERT(componentBinding->type == QV4::CompiledData::Binding::Type_Object); contextObject = componentBinding->value.objectIndex; } - for (auto it = obj->inlineComponentsBegin(); it != obj->inlineComponentsEnd(); ++it) - compileComponent(it->objectIndex); return compileJavaScriptCodeInObjectsRecursively(contextObject, contextObject); } @@ -1998,6 +1996,9 @@ bool JSCodeGen::compileJavaScriptCodeInObjectsRecursively(int objectIndex, int s if (object->flags & QV4::CompiledData::Object::IsComponent && !object->isInlineComponent) return true; + for (auto it = object->inlineComponentsBegin(); it != object->inlineComponentsEnd(); ++it) + compileComponent(it->objectIndex); + if (object->functionsAndExpressions->count > 0) { QList functionsToCompile; for (QmlIR::CompiledFunctionOrExpression *foe = object->functionsAndExpressions->first; foe; foe = foe->next) -- cgit v1.2.3