diff options
author | William Langford <wlangfor@gmail.com> | 2019-11-21 17:53:12 -0500 |
---|---|---|
committer | William Langford <wlangfor@gmail.com> | 2019-11-21 17:53:12 -0500 |
commit | e74eab828e658de3eca089f82b84fb67ed4c3a75 (patch) | |
tree | 843f4e7a3467cde286af373d5c4ec2d74fbfcaa7 | |
parent | bda75c3142d969e2a52301a1eaead0cc05ec2c13 (diff) | |
download | jq-e74eab828e658de3eca089f82b84fb67ed4c3a75.tar.gz |
Fix nesting try/catch inside internal errors
-rw-r--r-- | src/compile.c | 2 | ||||
-rw-r--r-- | tests/jq.test | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/compile.c b/src/compile.c index 7706c23..05478ab 100644 --- a/src/compile.c +++ b/src/compile.c @@ -1038,7 +1038,7 @@ block gen_try_handler(block handler) { return gen_cond(// `if type=="object" and .__jq gen_and(gen_call("_equal", BLOCK(gen_lambda(gen_const(jv_string("object"))), - gen_lambda(gen_noop()))), + gen_lambda(gen_call("type", gen_noop())))), BLOCK(gen_subexp(gen_const(jv_string("__jq"))), gen_noop(), gen_op_simple(INDEX))), diff --git a/tests/jq.test b/tests/jq.test index adc5788..1e0ce07 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -1712,3 +1712,7 @@ false .x - 10 {"x":13911860366432393} 13911860366432382 + +. |= try . catch . +1 +1
\ No newline at end of file |