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:
parent
386867da9f
commit
dc0b091c31
3 changed files with 24 additions and 5 deletions
|
@ -113,6 +113,7 @@ public:
|
|||
}
|
||||
|
||||
String to_string() const;
|
||||
bool to_boolean() const;
|
||||
|
||||
private:
|
||||
Type m_type { Type::Undefined };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue