mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +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:
Notes:
sideshowbarker
2024-07-17 01:55:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ce634957c1 Pull-request: https://github.com/SerenityOS/serenity/pull/18818
@@ -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