diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml index 3e2c289d..4028a943 100644 --- a/docs/content/manual/manual.yml +++ b/docs/content/manual/manual.yml @@ -1231,10 +1231,6 @@ sections: given as the argument. Errors can be caught with try/catch; see below. - When the error value is `null`, it produces nothing and works - just like `empty`. So `[null | error]` and `[error(null)]` both - emit `[]`. - examples: - program: 'try error catch .' input: '"error message"' diff --git a/jq.1.prebuilt b/jq.1.prebuilt index b2590acc..48b76220 100644 --- a/jq.1.prebuilt +++ b/jq.1.prebuilt @@ -1263,9 +1263,6 @@ jq \'[1,2,empty,3]\' .SS "error, error(message)" Produces an error with the input value, or with the message given as the argument\. Errors can be caught with try/catch; see below\. . -.P -When the error value is \fBnull\fR, it produces nothing and works just like \fBempty\fR\. So \fB[null | error]\fR and \fB[error(null)]\fR both emit \fB[]\fR\. -. .IP "" 4 . .nf diff --git a/src/jv.c b/src/jv.c index 933ed7be..cd2c1ac1 100644 --- a/src/jv.c +++ b/src/jv.c @@ -147,8 +147,6 @@ typedef struct { } jvp_invalid; jv jv_invalid_with_msg(jv err) { - if (JVP_HAS_KIND(err, JV_KIND_NULL)) - return JV_INVALID; jvp_invalid* i = jv_mem_alloc(sizeof(jvp_invalid)); i->refcnt = JV_REFCNT_INIT; i->errmsg = err; 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