Open Eswcvlad opened 1 month ago
I've updated the docs for value()
and hasProperty()
: https://github.com/adobe/json-formula/commit/4a9fd21a26123f179f166950a1ccc05b0858c5e4
I didn't bother to validate that the hidden property name was a string ... I suppose there's a very small chance that a non-string property parameter gets implicitly coerced to a hidden property name. But detecting that wasn't worth the extra code needed.
Currently in the implementation of
value
andhasProperty
, if there is a hidden propertyname
inobj
, type checking of arguments is ignored.This is codified in these tests:
value(address.street, "$name")
hasProperty(address.street, "$name")
It seems logical, that it would work that way (though I would still check, that
name
is a string), but it contradicts the current spec documentation.