We're updating the issue view to help you get more done. 

Query.reduce does not allow default value on the callback's first argument

Description

See http://blog.adamcameron.me/2017/04/cfml-lucee-13-v-4-14-v-6-coldfusion-we.html

See this test case:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 describe("reduce tests", function(){ var numbers = duplicate(baseNumbers); it ("accepts a default for the first argument", function(){ var ids = numbers.reduce(function(sum=[], row){ return sum.append(row.id); }); expect(ids).toBe([1,2,3,4]); }); it ("accepts an initial value", function(){ var ids = numbers.reduce(function(sum, row){ return sum.append(row.id); }, []); expect(ids).toBe([1,2,3,4]); }); });

The first test fails on Lucee because it does not respect the default value for that sum argument.

Environment

Status

Assignee

Michael Offner

Reporter

Adam Cameron

Affects versions

5.1.4.18

Priority

Minor