diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-03-22 14:49:21 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-04-05 08:09:19 +0000 |
commit | 7c18dcf79abbcc4de085e73ca7abe4eeeb7f140c (patch) | |
tree | 2517c9863549e3248aab0034a2ff4db6ba086322 /src/qml/compiler/qqmlirbuilder.cpp | |
parent | fcbbedc3c21ff69d9251264dd708d6ca66c09359 (diff) |
QML: add type info for the built-in qml context.
Previously, the type for the target temp would be 'var', which would
subsequently be corrected to qobject through a member access. That
resulted in typing the defining move again, which is unnecessary.
Change-Id: Ife993a667331e69aea64ac2af0f64096a142a583
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder.cpp')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 1960f1d65b..065e91109b 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1790,7 +1790,12 @@ void JSCodeGen::beginFunctionBodyHook() #ifndef V4_BOOTSTRAP QV4::IR::Temp *temp = _block->TEMP(_qmlContextTemp); - move(temp, _block->NAME(QV4::IR::Name::builtin_qml_context, 0, 0)); + temp->type = QV4::IR::QObjectType; + temp->memberResolver = _function->New<QV4::IR::MemberExpressionResolver>(); + initMetaObjectResolver(temp->memberResolver, _scopeObject); + auto name = _block->NAME(QV4::IR::Name::builtin_qml_context, 0, 0); + name->type = temp->type; + move(temp, name); move(_block->TEMP(_importedScriptsTemp), _block->NAME(QV4::IR::Name::builtin_qml_imported_scripts_object, 0, 0)); #endif |