Update obsolete contact address.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / v4 / qv4irbuilder.cpp
index c65b348..452cb43 100644 (file)
@@ -1,8 +1,8 @@
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the QtDeclarative module of the Qt Toolkit.
 **
@@ -314,24 +314,6 @@ bool QV4IRBuilder::visit(AST::UiQualifiedId *)
     return false;
 }
 
-bool QV4IRBuilder::visit(AST::UiSignature *)
-{
-    Q_ASSERT(!"unreachable");
-    return false;
-}
-
-bool QV4IRBuilder::visit(AST::UiFormalList *)
-{
-    Q_ASSERT(!"unreachable");
-    return false;
-}
-
-bool QV4IRBuilder::visit(AST::UiFormal *)
-{
-    Q_ASSERT(!"unreachable");
-    return false;
-}
-
 
 // JS
 bool QV4IRBuilder::visit(AST::Program *)
@@ -643,21 +625,23 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
                 break;
 
             case IR::Name::Property: 
-                if (baseName->type == IR::ObjectType) {
-                    QDeclarativePropertyData *data = baseName->property;
-                    if (!data || data->isFunction())
-                        return false; // Don't support methods (or non-existing properties ;)
+                if (baseName->type == IR::ObjectType && baseName->meta && baseName->property->isFinal()) {
+                    QDeclarativePropertyCache *cache = m_engine->cache(baseName->meta);
+                    if (!cache)
+                        return false;
+
+                    if (QDeclarativePropertyData *data = cache->property(name)) {
+                        if (!data->isFinal()) {
+                            if (qmlVerboseCompiler())
+                                qWarning() << "*** non-final property access:"
+                                           << (*baseName->id + QLatin1String(".") + ast->name.toString());
+                            return false; // We don't know enough about this property
+                        }
 
-                    if(!data->isFinal()) {
-                        if (qmlVerboseCompiler())
-                            qWarning() << "*** non-final property access:"
-                                << (*baseName->id + QLatin1String(".") + ast->name.toString());
-                        return false; // We don't know enough about this property
+                        IR::Type irType = irTypeFromVariantType(data->propType, m_engine, baseName->meta);
+                        _expr.code = _block->SYMBOL(baseName, irType, name,
+                                                    baseName->meta, data, line, column);
                     }
-
-                    IR::Type irType = irTypeFromVariantType(data->propType, m_engine, baseName->meta);
-                    _expr.code = _block->SYMBOL(baseName, irType, name,
-                                                baseName->meta, data, line, column);
                 }
                 break;