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

LibJS: Move the current exception from Interpreter to VM

This will allow us to throw exceptions even when there is no active
interpreter in the VM.
This commit is contained in:
Andreas Kling 2020-09-21 15:28:09 +02:00
parent 675b482fe7
commit 4a8bfcdd1c
12 changed files with 26 additions and 23 deletions

View file

@ -97,7 +97,7 @@ void Window::timer_did_fire(Badge<Timer>, Timer& timer)
auto& interpreter = document().interpreter();
(void)interpreter.call(timer.callback(), wrapper());
if (interpreter.exception())
interpreter.clear_exception();
interpreter.vm().clear_exception();
}
i32 Window::allocate_timer_id(Badge<Timer>)
@ -126,7 +126,7 @@ i32 Window::request_animation_frame(JS::Function& callback)
fake_timestamp += 10;
(void)interpreter.call(function, {}, JS::Value(fake_timestamp));
if (interpreter.exception())
interpreter.clear_exception();
interpreter.vm().clear_exception();
GUI::DisplayLink::unregister_callback(link_id);
});