pub unsafe extern "C" fn JSValueToInt32(
ctx: JSContextRef,
value: JSValueRef,
exception: *mut JSValueRef,
) -> i32Expand description
@function
@abstract Converts a JSValue to a singed 32-bit integer and returns the resulting integer.
@param ctx The execution context to use.
@param value The JSValue to convert.
@param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception.
@result An int32_t with the result of conversion, or 0 if an exception is thrown. Since 0 is valid value, exception must be checked after the call.
@discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the value is a BigInt, then the JSValue is truncated to an int32_t.