mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Port EnvironmentSettings URL Parsing to return Optional<URL>
This commit is contained in:
parent
5f5d18d719
commit
2c8dab36f3
Notes:
github-actions[bot]
2025-02-19 13:03:33 +00:00
Author: https://github.com/shannonbooth
Commit: 2c8dab36f3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3609
Reviewed-by: https://github.com/trflynn89
8 changed files with 25 additions and 25 deletions
|
@ -63,7 +63,7 @@ WebIDL::ExceptionOr<GC::Ref<Worker>> Worker::create(String const& script_url, Wo
|
|||
auto url = outside_settings.parse_url(script_url);
|
||||
|
||||
// 4. If this fails, throw a "SyntaxError" DOMException.
|
||||
if (!url.is_valid()) {
|
||||
if (!url.has_value()) {
|
||||
dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Invalid URL loaded '{}'.", script_url);
|
||||
return WebIDL::SyntaxError::create(document.realm(), "url is not valid"_string);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ WebIDL::ExceptionOr<GC::Ref<Worker>> Worker::create(String const& script_url, Wo
|
|||
|
||||
// 9. Run this step in parallel:
|
||||
// 1. Run a worker given worker, worker URL, outside settings, outside port, and options.
|
||||
worker->run_a_worker(url, outside_settings, *outside_port, options);
|
||||
worker->run_a_worker(url.value(), outside_settings, *outside_port, options);
|
||||
|
||||
// 10. Return worker
|
||||
return worker;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue