aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-26 15:58:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-02 14:49:37 +0100
commitb4e67a087e49e1a976a98977efc29e279285ae55 (patch)
tree0ae8d3b3b63b99300a6d9ca819cd4e40e7a7246a
parent1826cea72f73ec7f7ab2d834848537a249419974 (diff)
[new compiler] Report an error when trying to append to a read-only list
Change-Id: I9c6d7f2f0983274ecb8b7cc15c0dbe21f3e0d58f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index ce4a8770de..58ed18ba40 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -891,6 +891,11 @@ bool QQmlObjectCreator::setPropertyBinding(QQmlPropertyData *property, const QV4
if (_currentList.append)
_currentList.append(&_currentList, itemToAdd);
+ else {
+ recordError(binding->location, tr("Cannot assign object to read only list"));
+ return false;
+ }
+
} else {
// pointer compatibility was tested in QQmlPropertyValidator at type compile time
argv[0] = &createdSubObject;