mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb: Port named_item_value from DeprecatedFlyString
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user