From 4d121e54d989eb61d9f3dda67f00149dd3031f6b Mon Sep 17 00:00:00 2001 From: Haled Odat Date: Thu, 16 Mar 2023 23:42:46 +0000 Subject: [PATCH] Fix incorrect `Number.MIN_VALUE` value (#2682) This will fix the remaining test of the `multiplication` and `division` test suite It changes the following: - Change `Number.MIN_VALUE` from `f64::MIN_POSITIVE` to `5e-324` value --- boa_engine/src/builtins/number/mod.rs | 2 +- boa_engine/src/builtins/number/tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boa_engine/src/builtins/number/mod.rs b/boa_engine/src/builtins/number/mod.rs index 744bb4001e1..bb6c8c489cc 100644 --- a/boa_engine/src/builtins/number/mod.rs +++ b/boa_engine/src/builtins/number/mod.rs @@ -170,7 +170,7 @@ impl Number { /// /// [spec]: https://tc39.es/ecma262/#sec-number.min_value /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE - pub(crate) const MIN_VALUE: f64 = f64::MIN_POSITIVE; + pub(crate) const MIN_VALUE: f64 = 5e-324; /// This function returns a `JsResult` of the number `Value`. /// diff --git a/boa_engine/src/builtins/number/tests.rs b/boa_engine/src/builtins/number/tests.rs index 876e2dfd606..617016572fb 100644 --- a/boa_engine/src/builtins/number/tests.rs +++ b/boa_engine/src/builtins/number/tests.rs @@ -294,7 +294,7 @@ fn number_constants() { TestAction::assert_eq("Number.MAX_SAFE_INTEGER", Number::MAX_SAFE_INTEGER), TestAction::assert_eq("Number.MIN_SAFE_INTEGER", Number::MIN_SAFE_INTEGER), TestAction::assert_eq("Number.MAX_VALUE", f64::MAX), - TestAction::assert_eq("Number.MIN_VALUE", f64::MIN_POSITIVE), + TestAction::assert_eq("Number.MIN_VALUE", Number::MIN_VALUE), TestAction::assert_eq("Number.POSITIVE_INFINITY", f64::INFINITY), TestAction::assert_eq("Number.NEGATIVE_INFINITY", -f64::INFINITY), ]);