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