Brain fart or bug? Lucee 5, I'd expect the NULLs ...
# lucee
b
Brain fart or bug? Lucee 5, I'd expect the NULLs to be -1 in the output but they are still null
dump( [nullValue(), 6, nullValue(), 10].map( ( value ) => value ?: -1 ) );
It works when doing it this way...
Copy code
d2 = [];
for( value in [nullValue(), 6, nullValue(), 10] ) d2.append( value ?: -1 )
dump(d2);
w
bugfart?
b
fartbug?

https://www.pestworld.org/media/561856/brown-marmorated-stink-bug-_l0o9225.jpg

w
also know as 'clackers'
fwiw, seems like an implementation inconsistency with map
b
to support it being map and not the Hound Dog, same result with this (NULLs should be 0 but are still NULL)
[nullValue(),6,nullValue(),10].map( ( value ) => val(value) )
This converts the GOOD values to 'wth' but leaves the nulls...
[nullValue(),6,nullValue(),10].map( ( value ) => 'wth' );
b
@bhartsfield This is a Lucee bug if I'm understanding what you're doing
b
Definitely seems like map bug
b
Lucee's map/reduce/each functinos all skip null values
I just ran across this
There are tickets in JIRA for it
b
ahh
b
I had to change my code to a for loop
b
Thanks for the sanity check. Voted for the two open issues
You'd think something that obviously broken would be fixed by now 😕
b
oof... that's an old one
z
as it's somewhat a potential breaking change, i've added this to the 6.0 sprint, coz we are breaking stuff that needs to be broken with 6