Function JSValueToNumber

Source
pub unsafe extern "C" fn JSValueToNumber(
    ctx: JSContextRef,
    value: JSValueRef,
    exception: *mut JSValueRef,
) -> f64
Expand description

Converts a JavaScript value to number and returns the resulting number.

  • ctx: The execution context to use.
  • value: The JSValueRef to convert.
  • exception: A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Returns the numeric result of conversion, or NaN if an exception is thrown.