1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibJS: Add method to VM to clear the execution context stack

This is needed for the spin the event loop AO in LibWeb
This commit is contained in:
Andrew Kaster 2024-01-18 12:49:35 -07:00 committed by Alexander Kalenik
parent 682a6d5882
commit aef5932235
2 changed files with 6 additions and 0 deletions

View file

@ -742,6 +742,11 @@ void VM::save_execution_context_stack()
m_saved_execution_context_stacks.append(move(m_execution_context_stack));
}
void VM::clear_execution_context_stack()
{
m_execution_context_stack.clear_with_capacity();
}
void VM::restore_execution_context_stack()
{
m_execution_context_stack = m_saved_execution_context_stacks.take_last();