Function mozjs::conversions::enforce_range
source · unsafe fn enforce_range<D>(
cx: *mut JSContext,
d: f64,
) -> Result<ConversionResult<D>, ()>
Expand description
Try to cast the number to a smaller type, but if it doesn’t fit, it will return an error.