mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
Notes:
sideshowbarker
2024-07-19 07:17:54 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/35aea2e454e
@@ -46,15 +46,15 @@ public:
|
||||
Shape& shape() { return *m_shape; }
|
||||
const Shape& shape() const { return *m_shape; }
|
||||
|
||||
virtual Optional<Value> get_by_index(i32 property_index) const;
|
||||
Optional<Value> get(const FlyString& property_name) const;
|
||||
Optional<Value> get(PropertyName) const;
|
||||
virtual Value get_by_index(i32 property_index) const;
|
||||
Value get(const FlyString& property_name) const;
|
||||
Value get(PropertyName) const;
|
||||
|
||||
virtual void put_by_index(i32 property_index, Value);
|
||||
void put(const FlyString& property_name, Value);
|
||||
void put(PropertyName, Value);
|
||||
|
||||
Optional<Value> get_own_property(const Object& this_object, const FlyString& property_name) const;
|
||||
Value get_own_property(const Object& this_object, const FlyString& property_name) const;
|
||||
|
||||
enum class PutOwnPropertyMode {
|
||||
Put,
|
||||
|
||||
Reference in New Issue
Block a user