Index: src/array.js |
=================================================================== |
--- src/array.js (revision 12923) |
+++ src/array.js (working copy) |
@@ -1239,8 +1239,8 @@ |
var accumulator = new InternalArray(length); |
if (%DebugCallbackSupportsStepping(f)) { |
for (var i = 0; i < length; i++) { |
- if (i in array) { |
- var element = array[i]; |
+ var element = array[i]; |
+ if (!IS_UNDEFINED(element)) { |
Sven Panne
2012/11/11 15:51:41
Quick drive-by-comment: I think that this "optimiz
|
// Prepare break slots for debugger step in. |
%DebugPrepareStepInIfStepping(f); |
accumulator[i] = %_CallFunction(receiver, element, i, array, f); |
@@ -1249,8 +1249,8 @@ |
} else { |
// This is a duplicate of the previous loop sans debug stepping. |
for (var i = 0; i < length; i++) { |
- if (i in array) { |
- var element = array[i]; |
+ var element = array[i]; |
+ if (!IS_UNDEFINED(element)) { |
accumulator[i] = %_CallFunction(receiver, element, i, array, f); |
} |
} |