Store QQmlMetaObject in V4
authorAaron Kennedy <aaron.kennedy@nokia.com>
Fri, 25 May 2012 10:40:56 +0000 (11:40 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 25 May 2012 12:44:05 +0000 (14:44 +0200)
d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 caused a regression where V4
would not handle bindings as the meta object wasn't correctly stored in
the IR.

Change-Id: Id0af2175c15db69de9108060ff4901d0003de67b
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
src/qml/qml/v4/qv4irbuilder.cpp

index 354a8cd..ddc2264 100644 (file)
@@ -475,7 +475,7 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast)
 
                 if (data && !data->isFunction()) {
                     IR::Type irType = irTypeFromVariantType(data->propType, m_engine);
-                    _expr.code = _block->SYMBOL(irType, name, QQmlMetaObject(), data, IR::Name::ScopeStorage, line, column);
+                    _expr.code = _block->SYMBOL(irType, name, QQmlMetaObject(cache), data, IR::Name::ScopeStorage, line, column);
                     found = true;
                 } 
             }
@@ -495,7 +495,7 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast)
 
                 if (data && !data->isFunction()) {
                     IR::Type irType = irTypeFromVariantType(data->propType, m_engine);
-                    _expr.code = _block->SYMBOL(irType, name, QQmlMetaObject(), data, IR::Name::RootStorage, line, column);
+                    _expr.code = _block->SYMBOL(irType, name, QQmlMetaObject(cache), data, IR::Name::RootStorage, line, column);
                     found = true;
                 } 
             }
@@ -632,7 +632,7 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
                     QByteArray utf8Name = name.toUtf8();
                     const char *enumName = utf8Name.constData();
 
-                    const QMetaObject *meta = baseName->meta.metaObject(); // XXX - firstCppMetaObject
+                    const QMetaObject *meta = baseName->meta.propertyCache(m_engine)->firstCppMetaObject();
                     bool found = false;
                     for (int ii = 0; !found && ii < meta->enumeratorCount(); ++ii) {
                         QMetaEnum e = meta->enumerator(ii);
@@ -685,7 +685,7 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
                 }
 
                 IR::Type irType = irTypeFromVariantType(data->propType, m_engine);
-                _expr.code = _block->SYMBOL(baseName, irType, name, QQmlMetaObject(), data, line, column);
+                _expr.code = _block->SYMBOL(baseName, irType, name, QQmlMetaObject(cache), data, line, column);
                 }
                 break;