GNOME Bugzilla – Bug 741824
reader: Maintain a stack of member names
Last modified: 2015-01-25 17:02:52 UTC
Patch coming to fix json_reader_get_member_name() when using nested objects.
Created attachment 293136 [details] [review] reader: Maintain a stack of member names This fixes the case where, with nested objects, we call: json_reader_read_member (reader, "outer"); // json_reader_get_member_name (reader) == "outer" json_reader_read_member (reader, "inner"); // json_reader_get_member_name (reader) == "inner" // do something useful json_reader_end_member (reader); but at the end, the following assertion no longer holds: // json_reader_get_member_name (reader) == "outer" even though the JsonReader state should have been reset after ending the inner node. Fix it by maintaining a stack of member names. This works with both json_reader_read_member() and json_reader_read_element(). Updates to the unit tests are included.
Review of attachment 293136 [details] [review]: LGTM.
Attachment 293136 [details] pushed as 1f6668a - reader: Maintain a stack of member names