mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +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:
parent
682a6d5882
commit
aef5932235
2 changed files with 6 additions and 0 deletions
|
@ -742,6 +742,11 @@ void VM::save_execution_context_stack()
|
||||||
m_saved_execution_context_stacks.append(move(m_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()
|
void VM::restore_execution_context_stack()
|
||||||
{
|
{
|
||||||
m_execution_context_stack = m_saved_execution_context_stacks.take_last();
|
m_execution_context_stack = m_saved_execution_context_stacks.take_last();
|
||||||
|
|
|
@ -229,6 +229,7 @@ public:
|
||||||
ThrowCompletionOr<Value> named_evaluation_if_anonymous_function(ASTNode const& expression, DeprecatedFlyString const& name);
|
ThrowCompletionOr<Value> named_evaluation_if_anonymous_function(ASTNode const& expression, DeprecatedFlyString const& name);
|
||||||
|
|
||||||
void save_execution_context_stack();
|
void save_execution_context_stack();
|
||||||
|
void clear_execution_context_stack();
|
||||||
void restore_execution_context_stack();
|
void restore_execution_context_stack();
|
||||||
|
|
||||||
// Do not call this method unless you are sure this is the only and first module to be loaded in this vm.
|
// Do not call this method unless you are sure this is the only and first module to be loaded in this vm.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue