1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibJS: Implement basic boolean coercion

We can't expect the conditionals in "if" and "while" statements to
always return a bool, so we need to know how to boolify a JS::Value.
This commit is contained in:
Andreas Kling 2020-03-10 08:46:20 +01:00
parent 386867da9f
commit dc0b091c31
3 changed files with 24 additions and 5 deletions

View file

@ -113,6 +113,7 @@ public:
}
String to_string() const;
bool to_boolean() const;
private:
Type m_type { Type::Undefined };