Skip to content

Commit

Permalink
Fix nesting try/catch inside internal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wtlangford committed Nov 21, 2019
1 parent bda75c3 commit e74eab8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
Expand Down
4 changes: 4 additions & 0 deletions tests/jq.test
Original file line number Diff line number Diff line change
Expand Up @@ -1712,3 +1712,7 @@ false
.x - 10
{"x":13911860366432393}
13911860366432382

. |= try . catch .
1
1

0 comments on commit e74eab8

Please sign in to comment.