diff options
Diffstat (limited to 'src/lib/corelib/language/scriptengine.cpp')
-rw-r--r-- | src/lib/corelib/language/scriptengine.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/lib/corelib/language/scriptengine.cpp b/src/lib/corelib/language/scriptengine.cpp index bd7394b16..c5d4656cb 100644 --- a/src/lib/corelib/language/scriptengine.cpp +++ b/src/lib/corelib/language/scriptengine.cpp @@ -135,17 +135,10 @@ LookupResult ScriptEngine::doExtraScopeLookup(JSContext *ctx, JSAtom prop) ScriptEngine * const engine = engineForContext(ctx); engine->m_lastLookupWasSuccess = false; - JSValueList scopes; - - // FIXME: This is probably wrong, and kept only for "bug compatibility" - // The correct code should be the one commented out below. Fix for 2.1. - for (const auto &l : qAsConst(engine->m_scopeChains)) { - for (const auto &s : l) - scopes.push_back(s); - } - // if (!engine->m_scopeChains.isEmpty()) - // scopes = engine->m_scopeChains.last(); + JSValueList scopes; + if (!engine->m_scopeChains.isEmpty()) + scopes = engine->m_scopeChains.last(); if (JS_IsObject(engine->m_globalObject)) scopes.insert(scopes.begin(), engine->m_globalObject); for (auto it = scopes.rbegin(); it != scopes.rend(); ++it) { |