mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibJS: Convert internal_get() to ThrowCompletionOr
This commit is contained in:
parent
d9895ec12d
commit
6c2b974db2
17 changed files with 39 additions and 44 deletions
|
@ -18,7 +18,7 @@ JS::ThrowCompletionOr<bool> CSSStyleDeclarationWrapper::internal_has_property(JS
|
|||
return property_id != CSS::PropertyID::Invalid;
|
||||
}
|
||||
|
||||
JS::Value CSSStyleDeclarationWrapper::internal_get(JS::PropertyName const& name, JS::Value receiver) const
|
||||
JS::ThrowCompletionOr<JS::Value> CSSStyleDeclarationWrapper::internal_get(JS::PropertyName const& name, JS::Value receiver) const
|
||||
{
|
||||
if (!name.is_string())
|
||||
return Base::internal_get(name, receiver);
|
||||
|
@ -26,8 +26,8 @@ JS::Value CSSStyleDeclarationWrapper::internal_get(JS::PropertyName const& name,
|
|||
if (property_id == CSS::PropertyID::Invalid)
|
||||
return Base::internal_get(name, receiver);
|
||||
if (auto maybe_property = impl().property(property_id); maybe_property.has_value())
|
||||
return js_string(vm(), maybe_property->value->to_string());
|
||||
return js_string(vm(), String::empty());
|
||||
return { js_string(vm(), maybe_property->value->to_string()) };
|
||||
return { js_string(vm(), String::empty()) };
|
||||
}
|
||||
|
||||
bool CSSStyleDeclarationWrapper::internal_set(JS::PropertyName const& name, JS::Value value, JS::Value receiver)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue