mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 05:11:51 +00:00
LibURL+LibWeb: Make URL::serialize return a String
Simplifying a bunch of uneeded error handling around the place.
This commit is contained in:
parent
d7ac0601ab
commit
0fa54c2327
Notes:
github-actions[bot]
2024-12-04 16:48:13 +00:00
Author: https://github.com/shannonbooth
Commit: 0fa54c2327
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2727
Reviewed-by: https://github.com/AtkinsSJ ✅
52 changed files with 88 additions and 103 deletions
|
@ -107,7 +107,7 @@ Optional<DeprecatedFlyString> normalise_specifier_key(JS::Realm& realm, Deprecat
|
|||
|
||||
// 3. If url is not null, then return the serialization of url.
|
||||
if (url.has_value())
|
||||
return url->serialize();
|
||||
return url->serialize().to_byte_string();
|
||||
|
||||
// 4. Return specifierKey.
|
||||
return specifier_key;
|
||||
|
@ -160,7 +160,7 @@ WebIDL::ExceptionOr<ModuleSpecifierMap> sort_and_normalise_module_specifier_map(
|
|||
}
|
||||
|
||||
// 6. If specifierKey ends with U+002F (/), and the serialization of addressURL does not end with U+002F (/), then:
|
||||
if (specifier_key.as_string().ends_with("/"sv) && !address_url->serialize().ends_with("/"sv)) {
|
||||
if (specifier_key.as_string().ends_with("/"sv) && !address_url->serialize().ends_with('/')) {
|
||||
// 1. The user agent may report a warning to the console indicating that an invalid address was given for the specifier key specifierKey; since specifierKey ends with a slash, the address needs to as well.
|
||||
auto& console = realm.intrinsics().console_object()->console();
|
||||
console.output_debug_message(JS::Console::LogLevel::Warn,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue