From 345cd69293d8346799219b0a41ec4b62d2f12d7e Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Wed, 25 Dec 2024 21:30:01 -0500 Subject: [PATCH] Oops --- core/engine/src/value/conversions/mod.rs | 3 --- core/engine/src/value/conversions/try_from_js.rs | 3 +-- core/engine/src/value/mod.rs | 4 +--- core/engine/src/value/operations.rs | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/core/engine/src/value/conversions/mod.rs b/core/engine/src/value/conversions/mod.rs index ff823ea0539..982e2adf9a2 100644 --- a/core/engine/src/value/conversions/mod.rs +++ b/core/engine/src/value/conversions/mod.rs @@ -54,7 +54,6 @@ impl From for JsValue { fn from(value: f32) -> Self { let _timer = Profiler::global().start_event("From", "value"); - eprintln!("from(f32)... {}", value); Self::rational(f64::from(value)) } } @@ -64,7 +63,6 @@ impl From for JsValue { fn from(value: f64) -> Self { let _timer = Profiler::global().start_event("From", "value"); - eprintln!("from(f64)... {}", value); Self::rational(value) } } @@ -78,7 +76,6 @@ macro_rules! impl_from_integer { fn from(value: $type_) -> Self { let _timer = Profiler::global().start_event(concat!("From<", stringify!($type_), ">"), "value"); - eprintln!("from({})... {}", stringify!($type_), value); i32::try_from(value) .map_or_else( |_| Self::rational(value as f64), diff --git a/core/engine/src/value/conversions/try_from_js.rs b/core/engine/src/value/conversions/try_from_js.rs index 9e8499765c8..77533f6a9f8 100644 --- a/core/engine/src/value/conversions/try_from_js.rs +++ b/core/engine/src/value/conversions/try_from_js.rs @@ -162,7 +162,7 @@ impl TryFromJs for JsValue { impl TryFromJs for f64 { fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult { if let Some(i) = value.0.as_integer32() { - Ok(i as f64) + Ok(f64::from(i)) } else if let Some(f) = value.0.as_float64() { Ok(f) } else { @@ -189,7 +189,6 @@ macro_rules! impl_try_from_js_integer { $( impl TryFromJs for $type { fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult { - eprintln!("from_js... {:?} i32: {:?} number: {:?}", value, value.as_i32(), value.as_number()); if let Some(i) = value.as_i32() { i.try_into().map_err(|e| { JsNativeError::typ() diff --git a/core/engine/src/value/mod.rs b/core/engine/src/value/mod.rs index 826ce38cd7f..251c79d61cf 100644 --- a/core/engine/src/value/mod.rs +++ b/core/engine/src/value/mod.rs @@ -143,9 +143,7 @@ impl JsValue { // #[inline] #[must_use] pub fn rational(rational: f64) -> Self { - let inner = inner::InnerValue::float64(rational); - eprintln!("rational: {} = {:?} .. 0x{:x}", rational, inner, inner.0); - Self::from_inner(inner) + Self::from_inner(inner::InnerValue::float64(rational)) } /// Returns true if the value is an object. diff --git a/core/engine/src/value/operations.rs b/core/engine/src/value/operations.rs index 08cb319930a..eb717967150 100644 --- a/core/engine/src/value/operations.rs +++ b/core/engine/src/value/operations.rs @@ -482,7 +482,6 @@ impl JsValue { /// Returns the negated value. pub fn neg(&self, context: &mut Context) -> JsResult { - eprintln!("neg({:?})", self.variant()); Ok(match self.variant() { JsVariant::Symbol(_) | JsVariant::Undefined => Self::new(f64::NAN), JsVariant::Object(_) => Self::new(