mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
LibJS: Stop using Optional<Value> in favor of Value's empty state
JS::Value already has the empty state ({} or Value() gives you one.) Use this instead of wrapping Value in Optional in some places. I've also added Value::value_or(Value) so you can easily provide a fallback value when one is not present.
This commit is contained in:
parent
5adf4901df
commit
35aea2e454
14 changed files with 60 additions and 48 deletions
|
@ -40,7 +40,7 @@ public:
|
|||
i32 length() const { return m_length; }
|
||||
|
||||
virtual void put_by_index(i32 property_index, Value value) override;
|
||||
virtual Optional<Value> get_by_index(i32 property_index) const override;
|
||||
virtual Value get_by_index(i32 property_index) const override;
|
||||
|
||||
u8* data() { return m_data; }
|
||||
const u8* data() const { return m_data; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue