Allow C-coded functions to empty

Just return a jv_invalid() without a message.
This commit is contained in:
Nicolas Williams committed 2014-12-26 23:05:56 -06:00
1 parent bbb287f54b
commit 906d2537b9
1 file changed
+5 -1
+5 -1
View File
@@ -703,9 +703,13 @@ jv jq_next(jq_state *jq) {
if (jv_is_valid(top)) {
stack_push(jq, top);
} else {
} else if (jv_invalid_has_msg(jv_copy(top))) {
set_error(jq, top);
goto do_backtrack;
} else {
// C-coded function returns invalid w/o msg? -> backtrack, as if
// it had returned `empty`
goto do_backtrack;
}
break;
}