mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Begin implementing GlobalEnvironmentRecord
These represent the outermost scope in the environment record hierarchy. The spec says they should be a "composite" of two things: - An ObjectEnvironmentRecord wrapping the global object - A DeclarativeEnvironmentRecord for other declarations It's not yet clear to me how this should work, so this patch only implements the first part, an object record wrapping the global object.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <LibJS/AST.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/FunctionEnvironmentRecord.h>
|
||||
#include <LibJS/Runtime/GlobalEnvironmentRecord.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/Runtime/Reference.h>
|
||||
@@ -50,8 +51,8 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
|
||||
global_call_frame.this_value = &global_object;
|
||||
static FlyString global_execution_context_name = "(global execution context)";
|
||||
global_call_frame.function_name = global_execution_context_name;
|
||||
global_call_frame.lexical_environment = &global_object;
|
||||
global_call_frame.variable_environment = &global_object;
|
||||
global_call_frame.lexical_environment = &global_object.environment_record();
|
||||
global_call_frame.variable_environment = &global_object.environment_record();
|
||||
VERIFY(!vm.exception());
|
||||
global_call_frame.is_strict_mode = program.is_strict_mode();
|
||||
vm.push_call_frame(global_call_frame, global_object);
|
||||
|
||||
Reference in New Issue
Block a user