Function serialize_jsval_to_json_utf8

Source
pub fn serialize_jsval_to_json_utf8(
    cx: JSContext,
    data: Handle<'_, Value>,
) -> Result<DOMString, Error>
Expand description

Because this converts to a DOMString it becomes UTF-8 encoded which is closer to the spec definition of https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-json-bytes but we generally do not operate on anything that is truly a WTF-16 string.

https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string