With this code:
<cfset foo = {}>
<cfset exists1 = !isDefined("foo.foo")>
<cfset exists2 = isNull(foo.foo)>
<cfset exists3 = isNull(foo['foo'])>
Railo passes ok (all True) while CF throws an exception on the last line.
coldfusion.runtime.UndefinedElementException: Element foo is undefined in a CFML structure referenced as part of an expression.
I've always thought the dot notation and the square bracket notation in CFML should be functionally equivalent other than only square bracket can define case-sensitive keys.
A bug I reported here is recently marked "NotABug".
Can someone explain why?
I've added a comment to the bug. Basically the reason Adobe closed it as "not a bug", is because their engineer who triaged it is a muppet. It's def a bug.
And it's because of the bug your code doesn't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With