Skip to content

Commit 96fb071

Browse files
author
Caio Marcelo de Oliveira Filho
committed
QScriptContext: present the scopes in reverse order
The object in the last call for pushScope() should be the first one in the scopeChain() list. Reviewed-by: Olivier Goffart
1 parent 3627caf commit 96fb071

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/script/api/qscriptcontext_impl_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ inline void QScriptContextPrivate::setActivationObject(QScriptValuePrivate *acti
262262
inline QScriptValueList QScriptContextPrivate::scopeChain() const
263263
{
264264
QScriptValueList list;
265-
for (int i = 0; i < scopes.size(); ++i) {
265+
for (int i = scopes.size() - 1; i >= 0; --i) {
266266
v8::Handle<v8::Object> object = scopes.at(i)->GetExtensionObject();
267267
list.append(QScriptValuePrivate::get(new QScriptValuePrivate(engine, object)));
268268
}

0 commit comments

Comments
 (0)