Fat arrow functions shouldn't require parentheses around single parameter

Description

https://www.sitepoint.com/es6-arrow-functions-new-fat-concise-syntax-javascript/

When a fat arrow function only has only param, the parentheses should be optional:

prices = smartPhones.map( smartPhone => smartPhone.price );

Right now Lucee requires this syntax:

prices = smartPhones.map( ( smartPhone ) => smartPhone.price );

Activity

Show:

Brad Wood 25 September 2019 at 16:33

Here's a set of tests that show all known bugs in Lucee and Adobe CF's fat arrow functions along with a reference implementation in JS where everything passes.

https://github.com/bdw429s/CFML-lambda-fat-arrow-functions

Brad Wood 24 September 2019 at 22:34

Adobe 2018 update 5 came out today and supports this syntax. Transitioning this ticket to an incompatibility.

Brad Wood 23 September 2019 at 21:49

ACF 20128 U5 only allows the parens to be optional if there is no type or default specified.

John Berquist 23 September 2019 at 20:46

That all sounds good to me - I was wondering though if that syntax was valid in ACF?

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Priority

Created 14 August 2019 at 14:16
Updated 6 March 2025 at 11:35

Flag notifications