Status/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 07/13/2015
Components: Language
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 13
Pls implement shortcut notation for function expression as arrow functions, eg:
// long-hand
{code:java}
f = function(x,y){
return x +y;
}
{code}
// short hand
{code:java}
f = (x,y) => x+y;
{code}
Full syntax rules here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
this just makes it easier (clearer?) when using a lot of inline function expressions, such as BDD-inspired unit tests and the like.
Note Lucee has an implementation using a skinny arrow rather than match JS which uses the fat arrow.
Also they have implemented them to not be closures. Please do not do that.
Relevant Lucee tickets:
https://luceeserver.atlassian.net/browse/LDEV-249
https://luceeserver.atlassian.net/browse/LDEV-250
https://luceeserver.atlassian.net/browse/LDEV-252
Thanks
--
Adam
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4020372
External Customer Info:
External Company:
External Customer Name: Adam
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: