From 6882a55c5a84a7fb2a9cde34685d560bbb9e16a2 Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Fri, 19 Jul 2024 16:46:06 +0800 Subject: [PATCH] chore: merge match arm --- core/engine/src/value/operations.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/engine/src/value/operations.rs b/core/engine/src/value/operations.rs index 711dbd38e76..d243315beaa 100644 --- a/core/engine/src/value/operations.rs +++ b/core/engine/src/value/operations.rs @@ -477,10 +477,9 @@ impl JsValue { ), Self::String(ref str) => Self::new(-str.to_number()), Self::Rational(num) => Self::new(-num), - Self::Integer(0) => Self::new(-f64::from(0)), + Self::Integer(0) | Self::Boolean(false) | Self::Null => Self::new(-f64::from(0)), Self::Integer(num) => Self::new(-num), Self::Boolean(true) => Self::new(-f64::from(1)), - Self::Boolean(false) | Self::Null => Self::new(-f64::from(0)), Self::BigInt(ref x) => Self::new(JsBigInt::neg(x)), }) }