From 54b2d8c1b8db2921088372291d1d3d170ff4a3ee Mon Sep 17 00:00:00 2001 From: davidot Date: Thu, 17 Nov 2022 00:50:55 +0100 Subject: [PATCH] LibJS: Reuse as_i32 in as_double in JS::Value Since this might be complicated with NaN boxing keeping it as one implementation makes this easier to check and change. --- Userland/Libraries/LibJS/Runtime/Value.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index f23c3dc881..2eef14776a 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -292,7 +292,7 @@ public: { VERIFY(is_number()); if (is_int32()) - return static_cast(m_value.encoded); + return as_i32(); return m_value.as_double; }