&& !(b->flags & QV4::CompiledData::Binding::IsOnAssignment)) {
if (bindingNames.contains(b->propertyNameIndex))
return tr("Property value set multiple times");
- bindingNames.insert(b->propertyNameIndex);
}
+ bindingNames.insert(b->propertyNameIndex);
if (isListBinding) {
bindings->append(b);
} else if (bindingToDefaultProperty) {
qSwap(_object, object);
+ const int propertyNameIndex = registerString(name->name.toString());
+
+ if (bindingsTarget()->hasBinding(propertyNameIndex)) {
+ recordError(name->identifierToken, tr("Property value set multiple times"));
+ return false;
+ }
+
QQmlJS::AST::UiArrayMemberList *member = node->members;
while (member) {
QQmlJS::AST::UiObjectDefinition *def = QQmlJS::AST::cast<QQmlJS::AST::UiObjectDefinition*>(member->member);
int idx = 0;
if (!defineQMLObject(&idx, def))
return false;
- appendBinding(name->identifierToken, registerString(name->name.toString()), idx, /*isListItem*/ true);
+ appendBinding(name->identifierToken, propertyNameIndex, idx, /*isListItem*/ true);
member = member->next;
}
void appendFunction(QtQml::Function *f);
QString appendBinding(Binding *b, bool isListBinding);
+ bool hasBinding(int nameIndex) const { return bindingNames.contains(nameIndex); }
private:
PoolList<QmlProperty> *properties;