Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: test/mjsunit/array-reduce.js

Issue 614733002: Array.prototype.{reduce, reduceRight}: Wrong order of operations when determining initial value. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove unnneded check (length is zero and 'current' is not defined). Fixed tests. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/array.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-reduce.js
diff --git a/test/mjsunit/array-reduce.js b/test/mjsunit/array-reduce.js
index 429f34808d74152e25705b296dc584c2f41837e0..94e51440b154edb6dc2a6ae9f2b0cf10ca2f9343 100644
--- a/test/mjsunit/array-reduce.js
+++ b/test/mjsunit/array-reduce.js
@@ -521,3 +521,13 @@ testReduce("reduce", "ArrayManipulationExtender", 10,
[3, 3, 2, [1, 2, 3, 4, 4, 5], 6],
[6, 4, 3, [1, 2, 3, 4, 4, 5, 6], 10],
], arr, extender, 0);
+
+var arr = [];
+Object.defineProperty(arr, "0", { get: function() { delete this[0] },
+ configurable: true });
+assertEquals(undefined, arr.reduce(function(val) { return val }));
+
+var arr = [];
+Object.defineProperty(arr, "0", { get: function() { delete this[0] },
+ configurable: true});
+assertEquals(undefined, arr.reduceRight(function(val) { return val }));
« no previous file with comments | « src/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698