aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlirbuilder.cpp
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-05-11 16:31:57 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2021-05-12 11:02:48 +0200
commit1b0fc3af8f999f740d1a976a6be2bdea212ad586 (patch)
treed822df84f09034ded70cffb41a63f09a9097be99 /src/qml/compiler/qqmlirbuilder.cpp
parent7e8e21c87cc44f3ba4a2a597994d7cfd11c1ac5d (diff)
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 <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder.cpp')
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp5
1 files changed, 3 insertions, 2 deletions
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<QmlIR::CompiledFunctionOrExpression> functionsToCompile;
for (QmlIR::CompiledFunctionOrExpression *foe = object->functionsAndExpressions->first; foe; foe = foe->next)