diff options
Diffstat (limited to 'src/qml/jsruntime/qv4mapobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4mapobject.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4mapobject.cpp b/src/qml/jsruntime/qv4mapobject.cpp index 5e7f92a339..9355582906 100644 --- a/src/qml/jsruntime/qv4mapobject.cpp +++ b/src/qml/jsruntime/qv4mapobject.cpp @@ -280,12 +280,21 @@ ReturnedValue MapPrototype::method_forEach(const FunctionObject *b, const Value Value *arguments = scope.alloc(3); arguments[2] = that; - for (uint i = 0; i < that->d()->esTable->size(); ++i) { - that->d()->esTable->iterate(i, &arguments[1], &arguments[0]); // fill in key (0), value (1) + + ESTable::ShiftObserver observer{}; + that->d()->esTable->observeShifts(observer); + + while (observer.pivot < that->d()->esTable->size()) { + that->d()->esTable->iterate(observer.pivot, &arguments[1], &arguments[0]); // fill in key (0), value (1) callbackfn->call(thisArg, arguments, 3); CHECK_EXCEPTION(); + + observer.next(); } + + that->d()->esTable->stopObservingShifts(observer); + return Encode::undefined(); } |
