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

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: Created 6 years, 3 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
« src/array.js ('K') | « 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..3b243145027da05c13a16e85f2d2f7a29e6945a3 100644
--- a/test/mjsunit/array-reduce.js
+++ b/test/mjsunit/array-reduce.js
@@ -521,3 +521,15 @@ 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 a = [];
+Object.defineProperty(a, "0", { get: function() { delete this[0] },
+ configurable: true });
+var result = a.reduce(function(a) { return a });
+assertTrue(result === undefined);
+
+var a = [];
+Object.defineProperty(a, "0", {get: function() { delete this[0] },
wingo 2014/10/07 11:04:31 Inconsistent spacing here (before the get), and i
+ configurable: true});
+var result = a.reduceRight(function(a) { return a });
+assertTrue(result === undefined);
« src/array.js ('K') | « src/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698