Create property cache in case of Component{} root

Change-Id: I36f969d09d8ce5e0b68b657b514586990e88ebe4
Task-number: QTBUG-19354
(cherry picked from commit af1350249ea9de68e1c4b72ed1179948aa28ca19)
This commit is contained in:
Aaron Kennedy 2011-06-10 12:29:04 +10:00
parent 6e69712287
commit 281d15b90c
4 changed files with 23 additions and 0 deletions

View File

@ -650,6 +650,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
out->dumpInstructions();
if (compilerStatDump())
dumpStats();
Q_ASSERT(out->rootPropertyCache);
} else {
reset(out);
}
@ -1230,6 +1231,11 @@ void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj)
id.setId.index = obj->idIndex;
output->addInstruction(id);
}
if (obj == unitRoot) {
output->rootPropertyCache = output->types[obj->type].createPropertyCache(engine);
output->rootPropertyCache->addref();
}
}
bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,

View File

@ -0,0 +1,6 @@
import QtQuick 1.0
Component {
Item {
}
}

View File

@ -0,0 +1,4 @@
import QtQuick 1.0
NestedComponentRoot {
}

View File

@ -135,6 +135,7 @@ private slots:
void reservedWords_data();
void reservedWords();
void inlineAssignmentsOverrideBindings();
void nestedComponentRoots();
void basicRemote_data();
void basicRemote();
@ -1428,6 +1429,12 @@ void tst_qdeclarativelanguage::inlineAssignmentsOverrideBindings()
delete o;
}
// QTBUG-19354
void tst_qdeclarativelanguage::nestedComponentRoots()
{
QDeclarativeComponent component(&engine, TEST_FILE("nestedComponentRoots.qml"));
}
// Import tests (QT-558)
void tst_qdeclarativelanguage::importsBuiltin_data()
{