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:
parent
6e69712287
commit
281d15b90c
|
@ -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,
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
import QtQuick 1.0
|
||||
|
||||
Component {
|
||||
Item {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
import QtQuick 1.0
|
||||
|
||||
NestedComponentRoot {
|
||||
}
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue