Probable Lucee bug with `isObject` & `isValid`...
# lucee
a
Probable Lucee bug with
isObject
& `isValid`: https://trycf.com/gist/68714a07fd05f75f9edb7c05b7db0a47/lucee5?setupCodeGistId=816ce84fd991c2682df612dbaf1cad11&theme=monokai Compare behaviours of CF's baseline expectations, and Lucee. Lucee's behaviour is inconsistent with CF's, and also internally inconsistent. Or am I missing something?
z
I can't follow without the rest of the source?
d
@Adam Cameron, In Lucee, the
isObjectChecker
does not require the
object
argument, so
arguments.object
ends up being
null
and
isObject(nullValue())
is
false
. If you change the
isObjectChecker
to:
Copy code
var isObjectChecker = (required component object) => isObject(arguments.object)
Then the code throws an exception. So I think this issue is really in how Lucee deals with
null
values.
If I change all of the test functions to make the
object
argument
required
all the tests pass.
I suspect changing the Lucee
null
settings might change the behavior so that having
required
is not needed.
a
@dswitzer your changes result in a different thing being tested though. The whole point is the argument is not being passed. Changing it to "you need to pass the argument" is testing... something else that is not a concern here. The test is specifically testing
isObject
in the given context. The context being: the value it's being called on isn't defined.
@zackster not sure what you mean. All the relevant code is there.
d
@Adam Cameron I don't believe my test does change things. In Lucee,
isObject(nullValue())
returns
false
. This is why your tests are not throwing an exception. Since the
arguments.object
value is
null
, the
isObject()
call is returning false.
Take a look at this code for I think why you're seeing a difference: https://trycf.com/gist/91494a562253822c835d81f37122b4e1/acf2021?theme=monokai It's not the
isObject()
and
isValid()
calls, it's the difference between the way Lucee & ACF handle the arguments.
But maybe I'm misunderstanding your test cases.
What I think TryCF.com needs is a multiple Lucee environments. One that's like a default Lucee environment and one that's configured to try to match ACF compatibility as closely as possible. I say this, because I suspect the differences in the way that Lucee is handling
arguments.object
is related to the
null
settings in the Lucee Admin. (But I could be wrong about that.)
z
i wish try cf would treat lucee a bit more lie acf, only ever having the latest 5.3 is disappointing
a
Abram probably finds the Lucee approach to "issue/release significance" cf "versioning" about as impenetrable as I do 😉