summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcompiler.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-26 07:18:07 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-26 07:18:07 (GMT)
commitb227da8a17cd7b0facc3491d645209e277cb64b7 (patch)
tree0040b2cf9ce17acbe1e328eceb80df0166db50a8 /src/declarative/qml/qmlcompiler.cpp
parente52247f16e608134d1ff663774f930a00a431eb5 (diff)
downloadQt-b227da8a17cd7b0facc3491d645209e277cb64b7.zip
Qt-b227da8a17cd7b0facc3491d645209e277cb64b7.tar.gz
Qt-b227da8a17cd7b0facc3491d645209e277cb64b7.tar.bz2
Remove ResolveFetchObject instruction
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 0712136..ae915db 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -976,16 +976,16 @@ bool QmlCompiler::compileNestedProperty(QmlParser::Property *prop,
if (prop->type != 0)
prop->value->metatype = QmlMetaType::metaObjectForType(prop->type);
+ if (prop->index == -1)
+ COMPILE_EXCEPTION2(prop, "Cannot access non-existant property" << prop->name);
+
+ if (!QmlMetaType::isObject(prop->value->metatype))
+ COMPILE_EXCEPTION2(prop, "Cannot nest non-QObject property" << prop->name);
+
QmlInstruction fetch;
- if (prop->index != -1 &&
- QmlMetaType::isObject(prop->value->metatype)) {
- fetch.type = QmlInstruction::FetchObject;
- fetch.fetch.property = prop->index;
- fetch.fetch.isObject = true;
- } else {
- fetch.type = QmlInstruction::ResolveFetchObject;
- fetch.fetch.property = output->indexForByteArray(prop->name);
- }
+ fetch.type = QmlInstruction::FetchObject;
+ fetch.fetch.property = prop->index;
+ fetch.fetch.isObject = true;
fetch.line = prop->location.start.line;
output->bytecode << fetch;