Status: Accepted
Owner: [email protected]
Labels: Type-Bug Priority-Medium ES5

New issue 755 by [email protected]: Mapping functions on Array does includes entries added by callback function.
http://code.google.com/p/v8/issues/detail?id=755

All Array mapping functions (i.e., functions that iterate over an array applying a provided function to all entries) includes elements added to the array by the provided function.

Effected functions:
Array.prototype.every
Array.prototype.some
Array.prototype.forEach
Array.prototype.map
Array.prototype.filter
Array.prototype.reduce
Array.prototype.reduceRight

What will reproduce the problem (example for filter from es5conform):
 function callbackfn(val, idx, obj)
  {
    srcArr[2] = 3;
    srcArr[5] = 6;
    return true;
  }

  var srcArr = [1,2,,4,5];
  var resArr = srcArr.filter(callbackfn);
  print(resArr);
  print(srcArr);

Expected result:
  1,2,4,5
  1,2,3,4,5,6

Actual result:
  1,2,3,4,5
  1,2,3,4,5,6

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to