Previously, the function didn't terminate after calling the setter
recursively, as it should have. This patch ensures that the setter
is called correctly and then returns, and adds a unit test to ensure
that no regression occurs.
Task-number: QTBUG-23330
Change-Id: If512fca174e5224c2c53caad11f77782e6cead9f
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
if (index < propOffset) {
Q_ASSERT(parent);
static_cast<QDeclarativeVMEMetaObject *>(parent)->setVMEProperty(index, v);
+ return;
}
return writeVarProperty(index - propOffset, v);
}
--- /dev/null
+import QtQuick 2.0
+
+Item {
+ property var random: null
+}
--- /dev/null
+import QtQuick 2.0
+
+PropertyVarBaseItem {
+ property bool test: false
+ Component.onCompleted: {
+ test = true;
+ }
+}
QTest::newRow("javascript map assignment") << testFileUrl("propertyVar.7.qml");
QTest::newRow("literal property assignment") << testFileUrl("propertyVar.8.qml");
QTest::newRow("qobject property assignment") << testFileUrl("propertyVar.9.qml");
+ QTest::newRow("base class var property assignment") << testFileUrl("propertyVar.10.qml");
}
void tst_qdeclarativeecmascript::propertyVar()