mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibJS/Bytecode: Restore old environments when an exception is caught
Unwind contexts now remember the lexical and variable environments in effect when they were created. If an exception is caught, we revert to those environments in the running execution context.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Handle.h>
|
||||
|
||||
namespace JS::Bytecode {
|
||||
|
||||
@@ -16,6 +17,9 @@ struct UnwindInfo {
|
||||
Executable const* executable;
|
||||
BasicBlock const* handler;
|
||||
BasicBlock const* finalizer;
|
||||
|
||||
Handle<Environment> lexical_environment;
|
||||
Handle<Environment> variable_environment;
|
||||
};
|
||||
|
||||
class BasicBlock {
|
||||
|
||||
Reference in New Issue
Block a user