1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

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.
This commit is contained in:
davidot 2022-11-17 00:50:55 +01:00 committed by Linus Groh
parent 2e24ee49aa
commit 54b2d8c1b8

View file

@ -292,7 +292,7 @@ public:
{
VERIFY(is_number());
if (is_int32())
return static_cast<i32>(m_value.encoded);
return as_i32();
return m_value.as_double;
}