mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 09:05:09 +00:00
LibJS: Oops, non-zero values should boolify to true, not false
This commit is contained in:
parent
e9687ee50e
commit
a0e18f4450
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ bool Value::to_boolean() const
|
|||
case Type::Boolean:
|
||||
return m_value.as_bool;
|
||||
case Type::Number:
|
||||
return m_value.as_double == 0 || m_value.as_double == -0;
|
||||
return !(m_value.as_double == 0 || m_value.as_double == -0);
|
||||
case Type::Null:
|
||||
case Type::Undefined:
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue