mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibJS: Convert Instruction::execute in bytecode to ThrowCompletionOr
This allows us to use TRY in these functions :^).
This commit is contained in:
parent
de90d54be0
commit
8108fc7f9c
6 changed files with 238 additions and 294 deletions
|
@ -13,7 +13,6 @@
|
|||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibJS/Runtime/Exception.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS::Bytecode {
|
||||
|
@ -69,7 +68,7 @@ public:
|
|||
|
||||
void enter_unwind_context(Optional<Label> handler_target, Optional<Label> finalizer_target);
|
||||
void leave_unwind_context();
|
||||
void continue_pending_unwind(Label const& resume_label);
|
||||
ThrowCompletionOr<void> continue_pending_unwind(Label const& resume_label);
|
||||
|
||||
Executable const& current_executable() { return *m_current_executable; }
|
||||
|
||||
|
@ -93,7 +92,7 @@ private:
|
|||
Value m_return_value;
|
||||
Executable const* m_current_executable { nullptr };
|
||||
Vector<UnwindInfo> m_unwind_contexts;
|
||||
Handle<Exception> m_saved_exception;
|
||||
Handle<Value> m_saved_exception;
|
||||
};
|
||||
|
||||
extern bool g_dump_bytecode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue