From 01f9c623ed2dc1645ac022d69062f720e3b50132 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 13 Feb 2019 09:17:10 +0100 Subject: Don't optimize global lookups if fast QML lookups are disabled If fast QML lookups are disabled, we generally want to look up by string. If the name then happens to be a member of the global JavaScript object, we still don't want to directly access that, as the name could have been overridden in a deeper context. Fixes: QTBUG-73750 Change-Id: Id16110969123d91501064ba46bfad4c2a39e4650 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/compiler/qv4codegen.cpp') diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index fb3c66b123..04da41430c 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2404,7 +2404,7 @@ Codegen::Reference Codegen::referenceForName(const QString &name, bool isLhs, co Reference r = Reference::fromName(this, name); r.global = useFastLookups && (resolved.type == Context::ResolvedName::Global); - if (!r.global && m_globalNames.contains(name)) + if (!r.global && canAccelerateGlobalLookups() && m_globalNames.contains(name)) r.global = true; return r; } -- cgit v1.2.3