Object *object = 0;
if (!resolveQualifiedId(&name, &object))
return;
+ if (_object == object && name->name == QStringLiteral("id")) {
+ setId(name->identifierToken, value);
+ return;
+ }
qSwap(_object, object);
appendBinding(qualifiedNameLocation, name->identifierToken, registerString(name->name.toString()), value);
qSwap(_object, object);
void IRBuilder::appendBinding(const QQmlJS::AST::SourceLocation &qualifiedNameLocation, const QQmlJS::AST::SourceLocation &nameLocation, quint32 propertyNameIndex, QQmlJS::AST::Statement *value)
{
- if (stringAt(propertyNameIndex) == QStringLiteral("id")) {
- setId(nameLocation, value);
- return;
- }
-
Binding *binding = New<Binding>();
binding->propertyNameIndex = propertyNameIndex;
binding->location.line = nameLocation.startLine;
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QCOMPARE(object->getChildren()->count(), 1);
+ QCOMPARE(object->getChildren()->count(), 2);
MyTypeObject *child =
qobject_cast<MyTypeObject *>(object->getChildren()->at(0));
QVERIFY(child != 0);
QCOMPARE(child->id(), QString("myObjectId"));
QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child));
+
+ child =
+ qobject_cast<MyTypeObject *>(object->getChildren()->at(1));
+ QVERIFY(child != 0);
+ QCOMPARE(child->id(), QString("name.with.dots"));
}
// Tests automatic connection to notify signals if "onBlahChanged" syntax is used