1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibJS: Let the bytecode interpreter set the VM's last value

This commit is contained in:
Gunnar Beutner 2021-06-10 21:01:44 +02:00 committed by Andreas Kling
parent 023df8e596
commit 319a60043b
3 changed files with 7 additions and 2 deletions

View file

@ -43,7 +43,7 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
VM::InterpreterExecutionScope scope(*this);
vm.set_last_value({}, {});
vm.set_last_value(Badge<Interpreter> {}, {});
CallFrame global_call_frame;
global_call_frame.current_node = &program;
@ -56,7 +56,7 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
vm.push_call_frame(global_call_frame, global_object);
VERIFY(!vm.exception());
auto value = program.execute(*this, global_object);
vm.set_last_value({}, value.value_or(js_undefined()));
vm.set_last_value(Badge<Interpreter> {}, value.value_or(js_undefined()));
vm.pop_call_frame();