Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Dec 26, 2024
1 parent 084b25e commit 345cd69
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions core/engine/src/value/conversions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ impl From<f32> for JsValue {
fn from(value: f32) -> Self {
let _timer = Profiler::global().start_event("From<f32>", "value");

eprintln!("from(f32)... {}", value);
Self::rational(f64::from(value))
}
}
Expand All @@ -64,7 +63,6 @@ impl From<f64> for JsValue {
fn from(value: f64) -> Self {
let _timer = Profiler::global().start_event("From<f64>", "value");

eprintln!("from(f64)... {}", value);
Self::rational(value)
}
}
Expand All @@ -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),
Expand Down
3 changes: 1 addition & 2 deletions core/engine/src/value/conversions/try_from_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl TryFromJs for JsValue {
impl TryFromJs for f64 {
fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self> {
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 {
Expand All @@ -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<Self> {
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()
Expand Down
4 changes: 1 addition & 3 deletions core/engine/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion core/engine/src/value/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ impl JsValue {

/// Returns the negated value.
pub fn neg(&self, context: &mut Context) -> JsResult<Self> {
eprintln!("neg({:?})", self.variant());
Ok(match self.variant() {
JsVariant::Symbol(_) | JsVariant::Undefined => Self::new(f64::NAN),
JsVariant::Object(_) => Self::new(
Expand Down

0 comments on commit 345cd69

Please sign in to comment.