1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-01 10:52:12 +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

@ -84,7 +84,7 @@ JS::GCPtr<Plugin> PluginArray::item(u32 index) const
}
// https://html.spec.whatwg.org/multipage/system-state.html#dom-pluginarray-nameditem
JS::GCPtr<Plugin> PluginArray::named_item(String const& name) const
JS::GCPtr<Plugin> PluginArray::named_item(FlyString const& name) const
{
// 1. For each Plugin plugin of this's relevant global object's PDF viewer plugin objects: if plugin's name is name, then return plugin.
auto& window = verify_cast<HTML::Window>(HTML::relevant_global_object(*this));
@ -107,10 +107,9 @@ WebIDL::ExceptionOr<JS::Value> PluginArray::item_value(size_t index) const
return return_value.ptr();
}
WebIDL::ExceptionOr<JS::Value> PluginArray::named_item_value(DeprecatedFlyString const& name) const
WebIDL::ExceptionOr<JS::Value> PluginArray::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();