mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 16:10:20 +00:00
LibJS: Don't try to store negative zero as an Int32 JS::Value
This commit is contained in:
parent
6870349599
commit
14d598fe7f
Notes:
sideshowbarker
2024-07-18 21:10:52 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/14d598fe7f6
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ public:
|
|||
|
||||
explicit Value(double value)
|
||||
{
|
||||
if (value >= NumericLimits<i32>::min() && value <= NumericLimits<i32>::max() && static_cast<i32>(value) == value) {
|
||||
if (value >= NumericLimits<i32>::min() && value <= NumericLimits<i32>::max() && trunc(value) == value && value != -0.0) {
|
||||
m_type = Type::Int32;
|
||||
m_value.as_i32 = static_cast<i32>(value);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue