1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +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

@ -113,6 +113,7 @@ public:
VM& vm() { return *m_vm; }
Heap& heap() { return vm().heap(); }
Exception* exception() { return vm().exception(); }
void unwind(ScopeType type, FlyString label = {})
{
@ -195,12 +196,6 @@ public:
return m_call_stack.last().this_value;
}
Exception* exception()
{
return m_exception;
}
void clear_exception() { m_exception = nullptr; }
template<typename T, typename... Args>
void throw_exception(Args&&... args)
{
@ -252,8 +247,6 @@ private:
Handle<Object> m_global_object;
Exception* m_exception { nullptr };
ScopeType m_unwind_until { ScopeType::None };
FlyString m_unwind_until_label;