From f9a285daf2033b5393d5b521d27c0cc659515632 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 27 Jan 2014 13:09:01 +0100 Subject: [new compiler] Report errors when trying to bind to read-only properties The only exception are initializers for read-only property declarations. Also adjusted the error location of one test to point to the correct value location as opposed to the property location, as with all the other similar errors. Change-Id: I2333d3c485fc374b1b39a5f5a4408af5cf08a20f Reviewed-by: Lars Knoll --- src/qml/qml/qqmlcompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlcompiler.cpp') diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 0dd4ea015d..821ac4602d 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -3456,7 +3456,7 @@ bool QQmlCompiler::buildBinding(QQmlScript::Value *value, Q_ASSERT(prop->parent->metatype); if (!prop->core.isWritable() && !prop->core.isQList() && !prop->isReadOnlyDeclaration) - COMPILE_EXCEPTION(prop, tr("Invalid property assignment: \"%1\" is a read-only property").arg(prop->name().toString())); + COMPILE_EXCEPTION(value, tr("Invalid property assignment: \"%1\" is a read-only property").arg(prop->name().toString())); JSBindingReference *reference = pool->New(); reference->expression = value->value; -- cgit v1.2.3