It is pretty clear, that it would be implemented by just evaluating the expression with the argument as the contextual input JSON. But it is not quite clear, what that input should be in the json-formula context, when 0 arguments are provided.
In the current implementation, it looks like it just has js "undefined" as the input, which can leak in the results. For example, an expression like register("_identity", &@) || _identity() results in undefined.
Maybe it would be better to specify the default value for the argument in such cases, like null or {}?
Currently in the spec:
It is pretty clear, that it would be implemented by just evaluating the expression with the argument as the contextual input JSON. But it is not quite clear, what that input should be in the json-formula context, when 0 arguments are provided.
In the current implementation, it looks like it just has js "undefined" as the input, which can leak in the results. For example, an expression like
register("_identity", &@) || _identity()
results inundefined
.Maybe it would be better to specify the default value for the argument in such cases, like
null
or{}
?