JSC provides in its C API functions for JSValueMakeFromJSONString: https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/API/JSValueRef.h#L300 and JSValueCreateJSONString: https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/API/JSValueRef.h#L311 It would be great if we could have those exposed by specific new GLib API.
Created attachment 385749 [details] Patch
The API proposed LGTM. Thanks a lot, Carlos! I've not been able to try it yet, though.
Comment on attachment 385749 [details] Patch Patch LGTM. This looks very handy to get data in and out of a JSCContext, nicer than manually lots of API calls to build complex values. Also if some JSON comes from somewhere else and is to be loaded into a JSCContext, it seems much better to have this functionality than loading it as a string and having to use JSON.parse() later on in the JS side.
Committed r254331: <https://trac.webkit.org/changeset/254331>
<rdar://problem/58474734>