* Assert that the top of the open-stack is an object. */
| 69 | * Assert that the top of the open-stack is an object. |
| 70 | */ |
| 71 | static void assert_in_object(const struct json_writer *jw, const char *key) |
| 72 | { |
| 73 | if (!jw->open_stack.len) |
| 74 | BUG("json-writer: object: missing jw_object_begin(): '%s'", key); |
| 75 | if (jw->open_stack.buf[jw->open_stack.len - 1] != '{') |
| 76 | BUG("json-writer: object: not in object: '%s'", key); |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | * Assert that the top of the open-stack is an array. |