1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibJS: Add Value::is_nullish()

This commit is contained in:
Andreas Kling 2020-10-02 16:00:15 +02:00
parent ef1b21004f
commit fa18baf3e8
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())