Skip to main content

JS_ToInt32Sat

Function JS_ToInt32Sat 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn JS_ToInt32Sat( ctx: *mut JsContext, pres: *mut c_int, val: JsValue, ) -> c_int
Expand description

JS_ToInt32Sat: ToInt32 clamped to the int range instead of wrapped.

The reference’s -2^31 ..= 2^31-1 clamp, which a DataView offset check relies on: a wrapped offset would land inside the view.

§Safety

pres must be null or writable, val a live JSValue.