Fix tst_QJSValueIterator::iterateString() on Mac OS X
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 23 Jul 2013 10:52:05 +0000 (12:52 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 23 Jul 2013 11:00:24 +0000 (13:00 +0200)
commitb17f57df9d7d261c3e0739f2b589258cd2374d56
tree3e823aa47a9379b821ed4410b210edd81035e3cb
parente1b6513df584ad48fa92e383fd16e08293081bb9
Fix tst_QJSValueIterator::iterateString() on Mac OS X

The iterator stores the Property pointers the QV4::ObjectIterator returns,
which breaks when iterating over string objects, that always return the
same Property pointer in subsequence calls: &this->tmpProperty.

Given that internally QJSValueIterator already advanced the iterator to
the next property, value() will return the next value for strings instead
of the current value.

This patch eliminates the permanent storage of Property pointers in QJSValueIterator
and instead get()'s the properties when requested. This is slightly slower,
but safer.

Change-Id: I59028319a0b5dff339a7c9500f117b73f0677451
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
src/qml/qml/v8/qjsvalueiterator.cpp
src/qml/qml/v8/qjsvalueiterator_p.h