| 106 | } |
| 107 | |
| 108 | JSONValue json_object_get(JSONValue val, const char *name) |
| 109 | { |
| 110 | JSONProperty *f; |
| 111 | JSONObject *obj; |
| 112 | |
| 113 | if (val.type != JSON_OBJ) |
| 114 | return json_undefined_new(); |
| 115 | obj = val.u.obj; |
| 116 | f = json_object_get2(obj, name); |
| 117 | if (!f) |
| 118 | return json_undefined_new(); |
| 119 | return f->value; |
| 120 | } |
| 121 | |
| 122 | int json_object_set(JSONValue val, const char *name, JSONValue prop_val) |
| 123 | { |
no test coverage detected