From f94a9d463ffb3422861a0da140470dbf5ce76632 Mon Sep 17 00:00:00 2001 From: Emanuele Torre Date: Fri, 4 Aug 2023 22:52:27 +0200 Subject: 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. --- tests/jq.test | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/jq.test b/tests/jq.test index 3ba29add..94dec3fb 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -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 -- cgit v1.2.3