Skip to main content

JS_JSONStringify

Function JS_JSONStringify 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn JS_JSONStringify( ctx: *mut JsContext, obj: JsValue, replacer: JsValue, space0: JsValue, ) -> JsValue
Expand description

JS_JSONStringify: JSON.stringify(obj, replacer, space).

The engine’s own JSON.stringify is reached through the global object rather than through a Rust entry point, because the replacer can be an arbitrary script function and the engine’s implementation already handles every shape of it.

§Safety

All three values must be live.