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:
parent
5663a2d3b4
commit
9d60f23abc
21 changed files with 68 additions and 76 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue