aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-25 16:36:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-02 14:48:43 +0100
commit963875db263e4d1a04e03c4bb4fc20542bc8c21e (patch)
treecbb63607672e9d302d30389c8fe7553b27807b1f /src/qml/types
parent278ca02350c68a78c89bb34d99ee65968372a5fd (diff)
[new compiler] Compile functions and bindings in appropriate scopes
This enables accelerated property access also for this code path. Change-Id: Iafb177b1fe7878e6c54cfb258f2e8d8ea32aa59e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmllistmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index eed76ee09e..0dc1c2c25c 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -2387,8 +2387,9 @@ bool QQmlListModelParser::compileProperty(const QQmlCustomParserProperty &prop,
bool QQmlListModelParser::compileProperty(const QV4::CompiledData::QmlUnit *qmlUnit, const QV4::CompiledData::Binding *binding, QList<QQmlListModelParser::ListInstruction> &instr, QByteArray &data)
{
+ const quint32 targetObjectIndex = binding->value.objectIndex;
if (binding->type >= QV4::CompiledData::Binding::Type_Object) {
- const QV4::CompiledData::Object *target = qmlUnit->objectAt(binding->value.objectIndex);
+ const QV4::CompiledData::Object *target = qmlUnit->objectAt(targetObjectIndex);
QString objName = qmlUnit->header.stringAt(target->inheritedTypeNameIndex);
if (objName != listElementTypeName) {
const QMetaObject *mo = resolveType(objName);
@@ -2465,7 +2466,7 @@ bool QQmlListModelParser::compileProperty(const QV4::CompiledData::QmlUnit *qmlU
int v = evaluateEnum(script, &ok);
if (!ok) {
using namespace QQmlJS;
- AST::Node *node = astForBinding(binding->value.compiledScriptIndex);
+ AST::Node *node = astForBinding(targetObjectIndex, binding->value.compiledScriptIndex);
if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement*>(node))
node = stmt->expression;
AST::StringLiteral *literal = 0;