Index: test/mjsunit/array-reduce.js |
diff --git a/test/mjsunit/array-reduce.js b/test/mjsunit/array-reduce.js |
index 94e51440b154edb6dc2a6ae9f2b0cf10ca2f9343..f34d3ef6ff2439c412501af9457ef03ccab5355e 100644 |
--- a/test/mjsunit/array-reduce.js |
+++ b/test/mjsunit/array-reduce.js |
@@ -408,6 +408,12 @@ testReduce("reduceRight", "ArrayWithNonElementPropertiesReduceRight", 6, |
[5, 1, 0, arrayPlus, 6], |
], arrayPlus, sum, 0); |
+// Test passing undefined as initial value (to test missing parameter |
+// detection). |
+[1].reduce((a, b) => { assertEquals(a, undefined); assertEquals(b, 1) }, |
+ undefined); |
+[1, 2].reduce((a, b) => { assertEquals(a, 1); assertEquals(b, 2); }); |
+[1].reduce((a, b) => { assertTrue(false); }); |
// Test error conditions: |