aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/jsruntime/qv4estable.cpp4
-rw-r--r--src/qml/jsruntime/qv4mapobject.cpp4
-rw-r--r--tests/auto/qml/ecmascripttests/TestExpectations5
3 files changed, 4 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4estable.cpp b/src/qml/jsruntime/qv4estable.cpp
index 4b0eddb989..aa39971dc6 100644
--- a/src/qml/jsruntime/qv4estable.cpp
+++ b/src/qml/jsruntime/qv4estable.cpp
@@ -157,8 +157,8 @@ bool ESTable::remove(const Value &key)
}
if (found == true) {
- memmove(m_keys + idx, m_keys + idx + 1, m_size - idx);
- memmove(m_values + idx, m_values + idx + 1, m_size - idx);
+ memmove(m_keys + idx, m_keys + idx + 1, (m_size - idx)*sizeof(Value));
+ memmove(m_values + idx, m_values + idx + 1, (m_size - idx)*sizeof(Value));
m_size--;
}
return found;
diff --git a/src/qml/jsruntime/qv4mapobject.cpp b/src/qml/jsruntime/qv4mapobject.cpp
index 2c7978a14f..c598814fb6 100644
--- a/src/qml/jsruntime/qv4mapobject.cpp
+++ b/src/qml/jsruntime/qv4mapobject.cpp
@@ -303,10 +303,10 @@ ReturnedValue MapPrototype::method_forEach(const FunctionObject *b, const Value
thisArg = ScopedValue(scope, argv[1]);
Value *arguments = scope.alloc(3);
+ arguments[2] = that;
for (uint i = 0; i < that->d()->esTable->size(); ++i) {
- that->d()->esTable->iterate(i, &arguments[0], &arguments[1]); // fill in key (0), value (1)
+ that->d()->esTable->iterate(i, &arguments[1], &arguments[0]); // fill in key (0), value (1)
- arguments[2] = that;
callbackfn->call(thisArg, arguments, 3);
CHECK_EXCEPTION();
}
diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations
index 65c041e4d8..5f422766b7 100644
--- a/tests/auto/qml/ecmascripttests/TestExpectations
+++ b/tests/auto/qml/ecmascripttests/TestExpectations
@@ -206,12 +206,7 @@ built-ins/JSON/stringify/replacer-proxy-revoked.js fails
built-ins/JSON/stringify/replacer-proxy.js fails
built-ins/JSON/stringify/value-proxy.js fails
built-ins/Map/proto-from-ctor-realm.js fails
-built-ins/Map/prototype/forEach/callback-parameters.js fails
-built-ins/Map/prototype/forEach/deleted-values-during-foreach.js fails
-built-ins/Map/prototype/forEach/iterates-in-key-insertion-order.js fails
-built-ins/Map/prototype/forEach/iterates-values-added-after-foreach-begins.js fails
built-ins/Map/prototype/forEach/iterates-values-deleted-then-readded.js fails
-built-ins/Map/prototype/set/append-new-values.js fails
built-ins/Math/max/zeros.js fails
built-ins/Math/round/S15.8.2.15_A7.js fails
built-ins/Number/isFinite/arg-is-not-number.js fails