Adam Cameron
nuller = ()=>; // CF: fine; Lucee: Syntax Error, Invalid Construct on line 2
writeDump([isNull(nuller())])
https://trycf.com/gist/a2d193ecb21c454dbe13d932c6c99c61/lucee5?theme=monokai
And, yes, I did actually write code like that. Well actually it was nullValue = (()=>)(), but it's a similar issue.Michael Schmidt
06/08/2023, 4:26 PMnuller=()=>; /*errors*/
nuller=()=>{}; /* doesn't error */
nuller=()=>log; /* doesn't error */dswitzer
06/08/2023, 5:26 PMjavaCast("null", "")? It works in all flavors/versions of CF just fine and I think it's a lot easier to understand.bdw429s
06/08/2023, 5:27 PMbdw429s
06/08/2023, 5:28 PMnullValue() BIFbdw429s
06/08/2023, 5:28 PMAdam Cameron
javaCast and that's what I actually used; just I have always found it dead clunky, and there's precedent about the place for using a nuller function to effect the same thing. That got me thinking about exactly how much of the arrow function I actually needed to pull it off, as it were.
And @Michael Schmidt yeah, I started with the second of those options, but then wondered why I should need the function body when a short-hand arrow function simply returns the value of the expression. And nothing is an expression (of sorts).
I can see no reason why it oughtn't work, even if it's not exactly terribly clear code.
Cheers for the ticket URL, @bdw429s. And TIL nullValue is a thing in Lucee's CFML. I might use that instead of the javaCast approach. No need for cross-compat in my situation.bdw429s
06/08/2023, 5:53 PMAdam Cameron
Adam Cameron
zackster
06/08/2023, 7:00 PMzackster
06/08/2023, 7:01 PMAdam Cameron
zackster
06/08/2023, 7:53 PM