1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:35:08 +00:00

LibWeb: Port named_item_value from DeprecatedFlyString

This commit is contained in:
Shannon Booth 2023-10-08 13:16:50 +13:00 committed by Tim Flynn
parent c7cd6f2bef
commit b37aab1277
19 changed files with 33 additions and 36 deletions

View file

@ -98,7 +98,7 @@ JS::GCPtr<MimeType> Plugin::item(u32 index) const
return nullptr;
}
JS::GCPtr<MimeType> Plugin::named_item(String const& name) const
JS::GCPtr<MimeType> Plugin::named_item(FlyString const& name) const
{
// 1. For each MimeType mimeType of this's relevant global object's PDF viewer mime type objects: if mimeType's type is name, then return mimeType.
auto& window = verify_cast<HTML::Window>(HTML::relevant_global_object(*this));
@ -121,10 +121,9 @@ WebIDL::ExceptionOr<JS::Value> Plugin::item_value(size_t index) const
return return_value.ptr();
}
WebIDL::ExceptionOr<JS::Value> Plugin::named_item_value(DeprecatedFlyString const& name) const
WebIDL::ExceptionOr<JS::Value> Plugin::named_item_value(FlyString const& name) const
{
auto converted_name = TRY_OR_THROW_OOM(vm(), String::from_deprecated_string(name));
auto return_value = named_item(converted_name);
auto return_value = named_item(name);
if (!return_value)
return JS::js_null();
return return_value.ptr();