Handling null and undefined objects in ixsl:get() and ixsl:set-property
(Having already spent lots of time working on this, it's time to try to get the issues in writing.)
We need to clarify how
ixsl:set-property. Both the code and documentation need work.
Currently the documentation for
If the specified object or property does not exist, then the function returns the empty sequence (with a console log warning in the latter case). (Note the difference to the similar function
ixsl:call(), for which a run-time error is raised in this case.)
An error will be raised at run-time if the specified object does not exist or is not unique. If the specified property does not exist, then there is no error, but a warning is output in the console log.
Note that the property name string supplied to
ixsl:set-property can be a dot separated list of names to access a nested property; but we are not clear about what happens when we encounter null or undefined objects in such a nested chain of objects.
For instance consider
ixsl:get($object, 'a.b.c') and
$object.a.b returns null or undefined? Currently if either of these is null, Saxon-JS 2.2 crashes with an uncaught TypeError, so there is definitely a bug here.
Please register to edit this issue