mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibJS: Add Value::is_array()
This commit is contained in:
parent
f3c245fb96
commit
d7073b9f3e
Notes:
sideshowbarker
2024-07-19 08:07:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d7073b9f3e9
2 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,11 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
bool Value::is_array() const
|
||||
{
|
||||
return is_object() && as_object()->is_array();
|
||||
}
|
||||
|
||||
String Value::to_string() const
|
||||
{
|
||||
if (is_boolean())
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
bool is_object() const { return m_type == Type::Object; }
|
||||
bool is_boolean() const { return m_type == Type::Boolean; }
|
||||
bool is_cell() const { return is_string() || is_object(); }
|
||||
bool is_array() const;
|
||||
|
||||
Value()
|
||||
: m_type(Type::Undefined)
|
||||
|
|
Loading…
Add table
Reference in a new issue