mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Implement clean_up_after_running_script on a Realm
Taking further steps towards implementing the shadow realm spec :^)
This commit is contained in:
parent
0628b74272
commit
d6fdaf6b26
Notes:
github-actions[bot]
2024-11-01 19:16:25 +00:00
Author: https://github.com/shannonbooth
Commit: d6fdaf6b26
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1932
Reviewed-by: https://github.com/ADKaster ✅
10 changed files with 35 additions and 31 deletions
|
@ -250,7 +250,7 @@ ErrorOr<void> initialize_main_thread_vm(HTML::EventLoop::Type type)
|
|||
auto result = finalization_registry.cleanup();
|
||||
|
||||
// 5. Clean up after running script with entry.
|
||||
entry.clean_up_after_running_script();
|
||||
HTML::clean_up_after_running_script(realm);
|
||||
|
||||
// 6. If result is an abrupt completion, then report the exception given by result.[[Value]].
|
||||
if (result.is_error())
|
||||
|
@ -309,15 +309,15 @@ ErrorOr<void> initialize_main_thread_vm(HTML::EventLoop::Type type)
|
|||
// 3. Let result be job().
|
||||
auto result = job->function()();
|
||||
|
||||
// 4. If job settings is not null, then clean up after running script with job settings.
|
||||
if (job_settings) {
|
||||
// 4. If realm is not null, then clean up after running script with job settings.
|
||||
if (realm) {
|
||||
// IMPLEMENTATION DEFINED: Disassociate the realm execution context from the script or module.
|
||||
job_settings->realm_execution_context().script_or_module = Empty {};
|
||||
|
||||
// IMPLEMENTATION DEFINED: See comment above, we need to clean up the non-standard prepare_to_run_callback() call.
|
||||
job_settings->clean_up_after_running_callback();
|
||||
|
||||
job_settings->clean_up_after_running_script();
|
||||
HTML::clean_up_after_running_script(*realm);
|
||||
} else {
|
||||
// Pop off the dummy execution context. See the above FIXME block about why this is done.
|
||||
s_main_thread_vm->pop_execution_context();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue