Add From<f32> for JsValue
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
>
This Pull Request fixes/closes
It changes the following:
Implements From<f32> for JsValue
@@ -54,6 +54,18 @@ impl From<f64> for JsValue {
}
}
+impl From<f32> for JsValue {
+ #[allow(clippy::float_cmp)]
+ #[inline]
+ fn from(value: f32) -> Self {
+ // if value as i32 as f32 == value {
+ // Self::Integer(value as i32)
+ // } else {
+ Self::Rational(value.into())
+ // }
+ }
+}
+
impl From<u32> for JsValue {
#[inline]
fn from(value: u32) -> Self {
