Let error(null) throw null

This patch removes the weird behaviour of jv_invalid_with_msg(jv_null())
that returns jv_invalid() (i.e. empty), instead of a boxed jv_null().

The previous behaviour of  null|error  was obviously unintentional, and
allowing is jv_invalid_with_msg() to return values on which you can't
call jv_invalid_get_msg() is only error prone.
This commit is contained in:
Emanuele Torre authored and Nico Williams committed 2023-08-04 17:38:52 -05:00
1 parent 3b6e7ddd72
commit f94a9d463f
4 files changed
+4 -15

No files matched your search

+4 -6
View File
@@ -1270,13 +1270,11 @@ null
[null,true,{"a":1}]
[]
[1,error,2]
.[] | try error catch .
[1,null,2]
1
null
[1,2]
[1,error(null),2]
0
[1,2]
2
try error("\($__loc__)") catch .
null