Skip to main content

JS_PrintValue

Function JS_PrintValue 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn JS_PrintValue( ctx: *mut JsContext, write_func: PrintValueWrite, write_opaque: *mut c_void, val: JsValue, options: *const JSPrintValueOptions, )
Expand description

JS_PrintValue: render val through write_func.

The rendering is the engine’s own describe (the one a REPL uses), which prints strings quoted, objects as { a: 1 } and functions as [Function: f]. The options are accepted but only show_hidden is honoured, by way of the same describe; the three limits are not, and a caller relying on max_depth gets an unbounded rendering — stated in the README.

§Safety

write_func must be a JSPrintValueWrite; val a live JSValue.