Need a sanity check. What would you expect the out...
# adobe
b
Need a sanity check. What would you expect the output of
writeOutput( val("") ? "yes" : "no" )
to be? I'm getting "yes" in CF2025 and "no" in all past versions.
s
without looking at the docs, i would expect it to be "no" because i thought "val()" always returned a number, so i would think that "" would be a 0, aka false.
👍 2
b
Should be no for the reasons Steve said
q
same
b
val returns 0 for empty strings, and 0 is false
q
I'm assuming ACF returns something like [] or NaN.
b
I'd run a quick test, but 2025 isn't up on trycf yet
Can you test just
val("")
by itself and
0 ? "yes" : "no"
by itself?
b
cffiddle.org has a 2025 engine where I confirmed this as well as on a dev copy
val('") results in 0, and 0 has always been falsy up until now
0 ? "yes" : "no"
results in "no" as expected
b
check what the type of variable is coming out of val
Copy code
val("").getClass().getName()
It's a
java.lang.Double
on ACF 2023 and Lucee 6
And a
java.lang.Integer
on boxlang
Did that change on 2025?
b
java.lang.Double on 2025 as well
b
that's some crazy nonsense right there is passing an explicit
0
works but passing
val( "" )
doesn't
I guess file a ticket
b
I'm going to submit this as a bug, but I wanted to make sure I'm not missing something obvious before I do
b
perhaps they're creating incorrect bytecode in that case
b
It's gone in as CF-4225874
👍 2
0 ? "yes" : "no"
results in no, but
val(0) ? "yes" : "no"
results in yes. lovely.
😮 3
s
@Mark Takata (Adobe) - just making sure you saw the above. this definitely has me worried about upgrading.
👍 2
q
Value is yes, for "large values of 0"
😆 4
m
@nimitsharma heads up here, can you hurl an engineer at this to see where we zigged instead of zagging on this?
This returns as falsey if there are any nearby Grues in the shadows/darkness as protection for the programmer. (we're looking to see what's up here)
❤️ 3
b
@nimitsharma @Mark Takata (Adobe) I logged a bug (CF-4225874) if that's helpful
👍 2
n
@Ashudeep Sharma: Please check this issue.
👀 1
e
This is the code of a teenage girl trying to decide? all kidding aside, looks like a bug as cf2021 its a no
f
seems to apply only to the ternary operator:
Copy code
writeOutput( val("") ? "yes" : "no" );
if ( val("") ) {
        writeOutput("yup");
} else {
        writeOutput("nope");
}
outputs
yesnope
on CF2025
I see you noted that in your ticket, just looking at it now
b
I got and tested a hotfix from someone at Adobe this morning, so I'm happy to see there's some acknowledgement and movement on it
👍 2
👍🏼 1
f
nice - good to hear
a
The patch with the fix has been attached to https://tracker.adobe.com/#/view/CF-4225874
❤️ 3
b
Thanks, @Ashudeep Sharma. I am unable to run the Jar because of "no main manifest attribute".
Nevermind. Placing the Jar in /lib/updates/ did the trick.
👍 1