mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 04:50:29 +00:00
LibJS: Oops, non-zero values should boolify to true, not false
This commit is contained in:
parent
e9687ee50e
commit
a0e18f4450
Notes:
sideshowbarker
2024-07-19 08:47:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a0e18f4450d
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…
Reference in a new issue