mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
LibJS: Fix that the interpreter did not clear the unwind status
This meant that if some program threw an uncaught exception VM still had unwind_until set. This caused any further programs to not execute correctly. This will be fixed more thoroughly once we use Completions in the AST. Fixes #10323
This commit is contained in:
parent
f4f1397735
commit
ac808a261f
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,10 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
|
||||||
auto value = program.execute(*this, global_object);
|
auto value = program.execute(*this, global_object);
|
||||||
vm.set_last_value(Badge<Interpreter> {}, value.value_or(js_undefined()));
|
vm.set_last_value(Badge<Interpreter> {}, value.value_or(js_undefined()));
|
||||||
|
|
||||||
|
// FIXME: We unconditionally stop the unwind here this should be done using completions leaving
|
||||||
|
// the VM in a cleaner state after executing. For example it does still store the exception.
|
||||||
|
vm.stop_unwind();
|
||||||
|
|
||||||
vm.pop_execution_context();
|
vm.pop_execution_context();
|
||||||
|
|
||||||
// At this point we may have already run any queued promise jobs via on_call_stack_emptied,
|
// At this point we may have already run any queued promise jobs via on_call_stack_emptied,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue