/****************************************************************************
**
-** 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.
**
#include "qv4irbuilder_p.h"
#include "qv4compiler_p_p.h"
-#include <private/qquickanchors_p_p.h> // For AnchorLine
+#include <private/qdeclarativemetatype_p.h>
#include <private/qdeclarativetypenamecache_p.h>
DEFINE_BOOL_CONFIG_OPTION(qmlVerboseCompiler, QML_VERBOSE_COMPILER)
default:
if (t == qMetaTypeId<QDeclarative1AnchorLine>())
return IR::AnchorLineType;
- else if (t == qMetaTypeId<QQuickAnchorLine>())
+ else if (t == QDeclarativeMetaType::QQuickAnchorLineMetaTypeId())
return IR::SGAnchorLineType;
else if (engine->metaObjectForType(t)) {
return IR::ObjectType;
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 *)
if (data && !data->isFunction()) {
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, metaObject);
- _expr.code = _block->SYMBOL(irType, name, metaObject, data->coreIndex, IR::Name::ScopeStorage, line, column);
+ _expr.code = _block->SYMBOL(irType, name, metaObject, data, IR::Name::ScopeStorage, line, column);
found = true;
}
}
if (data && !data->isFunction()) {
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, metaObject);
- _expr.code = _block->SYMBOL(irType, name, metaObject, data->coreIndex, IR::Name::RootStorage, line, column);
+ _expr.code = _block->SYMBOL(irType, name, metaObject, data, IR::Name::RootStorage, line, column);
found = true;
}
}
}
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, attachedMeta);
- _expr.code = _block->SYMBOL(baseName, irType, name, attachedMeta, data->coreIndex, line, column);
+ _expr.code = _block->SYMBOL(baseName, irType, name, attachedMeta, data, line, column);
}
break;
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, idObject->metaObject());
_expr.code = _block->SYMBOL(baseName, irType, name,
- idObject->metaObject(), data->coreIndex, line, column);
+ idObject->metaObject(), data, line, column);
}
break;
case IR::Name::Property:
- if (baseName->type == IR::ObjectType) {
- const QMetaObject *m =
- m_engine->metaObjectForType(baseName->meta->property(baseName->index).userType());
- QDeclarativePropertyCache *cache = m_engine->cache(m);
-
- QDeclarativePropertyData *data = cache->property(name);
-
- 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->coreIndex, line, column);
}
break;