Skip to content

Instantly share code, notes, and snippets.

@mattrobenolt
Created November 10, 2012 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattrobenolt/4052881 to your computer and use it in GitHub Desktop.
Save mattrobenolt/4052881 to your computer and use it in GitHub Desktop.
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)) {
// 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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment