mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 22:29:13 +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:
@@ -72,7 +72,7 @@ void Uint8ClampedArray::put_by_index(i32 property_index, Value value)
|
||||
m_data[property_index] = clamp(value.to_i32(), 0, 255);
|
||||
}
|
||||
|
||||
Optional<Value> Uint8ClampedArray::get_by_index(i32 property_index) const
|
||||
Value Uint8ClampedArray::get_by_index(i32 property_index) const
|
||||
{
|
||||
ASSERT(property_index >= 0);
|
||||
ASSERT(property_index < m_length);
|
||||
|
||||
Reference in New Issue
Block a user