LibJS: Add Value::is_nullish()

This commit is contained in:
Andreas Kling 2020-10-02 16:00:15 +02:00
commit fa18baf3e8
Notes: sideshowbarker 2024-07-19 02:05:54 +09:00
9 changed files with 22 additions and 21 deletions

View file

@ -851,7 +851,7 @@ bool abstract_eq(GlobalObject& global_object, Value lhs, Value rhs)
if (lhs.type() == rhs.type())
return strict_eq(lhs, rhs);
if ((lhs.is_undefined() || lhs.is_null()) && (rhs.is_undefined() || rhs.is_null()))
if (lhs.is_nullish() && rhs.is_nullish())
return true;
if (lhs.is_number() && rhs.is_string())