1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibWeb: Port LegacyPlatformObject from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-11-21 12:15:56 +13:00 committed by Tim Flynn
parent 56d10bf198
commit f43313d099
6 changed files with 32 additions and 30 deletions

View file

@ -167,18 +167,18 @@ WebIDL::ExceptionOr<JS::Value> Storage::named_item_value(FlyString const& name)
return JS::PrimitiveString::create(vm(), value.release_value());
}
WebIDL::ExceptionOr<Bindings::LegacyPlatformObject::DidDeletionFail> Storage::delete_value(DeprecatedString const& name)
WebIDL::ExceptionOr<Bindings::LegacyPlatformObject::DidDeletionFail> Storage::delete_value(String const& name)
{
remove_item(name);
return DidDeletionFail::NotRelevant;
}
WebIDL::ExceptionOr<void> Storage::set_value_of_named_property(DeprecatedString const& key, JS::Value unconverted_value)
WebIDL::ExceptionOr<void> Storage::set_value_of_named_property(String const& key, JS::Value unconverted_value)
{
// NOTE: Since LegacyPlatformObject does not know the type of value, we must convert it ourselves.
// The type of `value` is `DOMString`.
auto value = TRY(unconverted_value.to_string(vm()));
return set_item(String::from_deprecated_string(key).release_value(), value);
return set_item(key, value);
}
void Storage::dump() const