LibJS: Pop execution context after running queued jobs in run()
These would crash starting with the next commit otherwise, calling a function always requires the running execution context to exist.
This commit is contained in:
parent
72f5252826
commit
58c34012dd
Notes:
sideshowbarker
2024-07-18 02:53:23 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/58c34012dd5 Pull-request: https://github.com/SerenityOS/serenity/pull/10402 Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 2 additions and 2 deletions
|
@ -67,14 +67,14 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
|
|||
// the VM in a cleaner state after executing. For example it does still store the exception.
|
||||
vm.stop_unwind();
|
||||
|
||||
vm.pop_execution_context();
|
||||
|
||||
// At this point we may have already run any queued promise jobs via on_call_stack_emptied,
|
||||
// in which case this is a no-op.
|
||||
vm.run_queued_promise_jobs();
|
||||
|
||||
vm.run_queued_finalization_registry_cleanup_jobs();
|
||||
|
||||
vm.pop_execution_context();
|
||||
|
||||
vm.finish_execution_generation();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue