Index: src/collection.js |
diff --git a/src/collection.js b/src/collection.js |
index 8ddf8e1001712e97b9a231d33889a5aa14a9c309..01e7c536f9607f097c906028669f43be3fb0cee2 100644 |
--- a/src/collection.js |
+++ b/src/collection.js |
@@ -129,11 +129,13 @@ function SetForEach(f, receiver) { |
} |
var iterator = new SetIterator(this, ITERATOR_KIND_VALUES); |
- var entry; |
+ var key; |
var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f); |
- while (!(entry = %SetIteratorNext(iterator)).done) { |
+ var value_array = [UNDEFINED]; |
+ while (%SetIteratorNext(iterator, value_array)) { |
if (stepping) %DebugPrepareStepInIfStepping(f); |
- %_CallFunction(receiver, entry.value, entry.value, this, f); |
+ key = value_array[0]; |
+ %_CallFunction(receiver, key, key, this, f); |
} |
} |
@@ -264,11 +266,11 @@ function MapForEach(f, receiver) { |
} |
var iterator = new MapIterator(this, ITERATOR_KIND_ENTRIES); |
- var entry; |
var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f); |
- while (!(entry = %MapIteratorNext(iterator)).done) { |
+ var value_array = [UNDEFINED, UNDEFINED]; |
+ while (%MapIteratorNext(iterator, value_array)) { |
if (stepping) %DebugPrepareStepInIfStepping(f); |
- %_CallFunction(receiver, entry.value[1], entry.value[0], this, f); |
+ %_CallFunction(receiver, value_array[1], value_array[0], this, f); |
} |
} |