mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibWeb: Use the realm from the ServiceWorker
client
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
`vm.realm()` might not exist, and was probably not even the right realm to use in the first place.
This commit is contained in:
parent
3da20aca65
commit
7402ae3a00
Notes:
github-actions[bot]
2024-11-03 22:27:43 +00:00
Author: https://github.com/yyny Commit: https://github.com/LadybirdBrowser/ladybird/commit/7402ae3a00b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2138 Reviewed-by: https://github.com/shannonbooth Reviewed-by: https://github.com/tcl3
1 changed files with 2 additions and 2 deletions
|
@ -401,7 +401,7 @@ static void update(JS::VM& vm, JS::NonnullGCPtr<Job> job)
|
|||
// 16. If runResult is failure or an abrupt completion, then:
|
||||
// 17. Else, invoke Install algorithm with job, worker, and registration as its arguments.
|
||||
if (job->client) {
|
||||
auto& realm = *vm.current_realm();
|
||||
auto& realm = job->client->realm();
|
||||
auto context = HTML::TemporaryExecutionContext(realm, HTML::TemporaryExecutionContext::CallbacksEnabled::Yes);
|
||||
WebIDL::reject_promise(realm, *job->job_promise, *vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Run Service Worker"sv).value());
|
||||
finish_job(vm, job);
|
||||
|
@ -428,7 +428,7 @@ static void unregister(JS::VM& vm, JS::NonnullGCPtr<Job> job)
|
|||
{
|
||||
// If there's no client, there won't be any promises to resolve
|
||||
if (job->client) {
|
||||
auto& realm = *vm.current_realm();
|
||||
auto& realm = job->client->realm();
|
||||
auto context = HTML::TemporaryExecutionContext(realm, HTML::TemporaryExecutionContext::CallbacksEnabled::Yes);
|
||||
WebIDL::reject_promise(realm, *job->job_promise, *vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Service Worker unregistration"sv).value());
|
||||
finish_job(vm, job);
|
||||
|
|
Loading…
Reference in a new issue