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

AK: Port URL::m_fragment from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-08-12 16:52:42 +12:00 committed by Andrew Kaster
parent 5663a2d3b4
commit 9d60f23abc
21 changed files with 68 additions and 76 deletions

View file

@ -123,11 +123,11 @@ WebIDL::ExceptionOr<String> WorkerLocation::hash() const
auto const& fragment = m_global_scope->url().fragment();
// 2. If fragment is either null or the empty string, return the empty string.
if (fragment.is_empty())
if (!fragment.has_value() || fragment->is_empty())
return String {};
// 3. Return "#", followed by fragment.
return TRY_OR_THROW_OOM(vm, String::formatted("#{}", fragment.view()));
return TRY_OR_THROW_OOM(vm, String::formatted("#{}", *fragment));
}
WorkerLocation::WorkerLocation(WorkerGlobalScope& global_scope)