unsafe fn enforce_range<D>( cx: *mut JSContext, d: f64, ) -> Result<ConversionResult<D>, ()>where D: Number + As<f64>, f64: As<D>,
Try to cast the number to a smaller type, but if it doesn’t fit, it will return an error.