Index: src/js/array.js |
diff --git a/src/js/array.js b/src/js/array.js |
index b29ad781706c1e44f3b257a150939b8b2f5ac4ba..4e3c8a1cfb24c5b95d3219f647ac332a5f3321c9 100644 |
--- a/src/js/array.js |
+++ b/src/js/array.js |
@@ -1212,9 +1212,12 @@ |
var accumulator = new InternalArray(); |
var accumulator_length = 0; |
var is_array = IS_ARRAY(array); |
+ var stepping = DEBUG_IS_STEPPING(f); |
for (var i = 0; i < length; i++) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(f); |
if (%_Call(f, receiver, element, i, array)) { |
accumulator[accumulator_length++] = element; |
} |
@@ -1241,9 +1244,12 @@ |
if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); |
var is_array = IS_ARRAY(array); |
+ var stepping = DEBUG_IS_STEPPING(f); |
for (var i = 0; i < length; i++) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(f); |
%_Call(f, receiver, element, i, array); |
} |
} |
@@ -1265,9 +1271,12 @@ |
if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); |
var is_array = IS_ARRAY(array); |
+ var stepping = DEBUG_IS_STEPPING(f); |
for (var i = 0; i < length; i++) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(f); |
if (%_Call(f, receiver, element, i, array)) return true; |
} |
} |
@@ -1292,9 +1301,12 @@ |
if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); |
var is_array = IS_ARRAY(array); |
+ var stepping = DEBUG_IS_STEPPING(f); |
for (var i = 0; i < length; i++) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(f); |
if (!%_Call(f, receiver, element, i, array)) return false; |
} |
} |
@@ -1317,9 +1329,12 @@ |
var accumulator = new InternalArray(length); |
var is_array = IS_ARRAY(array); |
+ var stepping = DEBUG_IS_STEPPING(f); |
for (var i = 0; i < length; i++) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(f); |
accumulator[i] = %_Call(f, receiver, element, i, array); |
} |
} |
@@ -1482,9 +1497,12 @@ |
throw MakeTypeError(kReduceNoInitial); |
} |
+ var stepping = DEBUG_IS_STEPPING(callback); |
for (; i < length; i++) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(callback); |
current = callback(current, element, i, array); |
} |
} |
@@ -1522,9 +1540,12 @@ |
throw MakeTypeError(kReduceNoInitial); |
} |
+ var stepping = DEBUG_IS_STEPPING(callback); |
for (; i >= 0; i--) { |
if (HAS_INDEX(array, i, is_array)) { |
var element = array[i]; |
+ // Prepare break slots for debugger step in. |
+ if (stepping) %DebugPrepareStepInIfStepping(callback); |
current = callback(current, element, i, array); |
} |
} |