Function JSValueCreateJSONString

Source
pub unsafe extern "C" fn JSValueCreateJSONString(
    ctx: JSContextRef,
    value: JSValueRef,
    indent: c_uint,
    exception: *mut JSValueRef,
) -> JSStringRef
Expand description

Creates a JavaScript string containing the JSON serialized representation of a JS value.

  • ctx: The execution context to use.
  • value: The value to serialize.
  • indent: The number of spaces to indent when nesting. If 0, the resulting JSON will not contains newlines. The size of the indent is clamped to 10 spaces.
  • exception: A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Returns a JSStringRef with the result of serialization, or NULL if an exception is thrown.