1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

LibJS: Drop "Record" suffix from all the *Environment record classes

"Records" in the spec are basically C++ classes, so let's drop this
mouthful of a suffix.
This commit is contained in:
Andreas Kling 2021-07-01 12:24:46 +02:00
parent 56d25d7210
commit 44221756ab
40 changed files with 366 additions and 366 deletions

View file

@ -15,14 +15,14 @@
#include <LibJS/Runtime/Array.h>
#include <LibJS/Runtime/ArrayPrototype.h>
#include <LibJS/Runtime/BoundFunction.h>
#include <LibJS/Runtime/DeclarativeEnvironmentRecord.h>
#include <LibJS/Runtime/DeclarativeEnvironment.h>
#include <LibJS/Runtime/ErrorTypes.h>
#include <LibJS/Runtime/FunctionEnvironmentRecord.h>
#include <LibJS/Runtime/FunctionEnvironment.h>
#include <LibJS/Runtime/FunctionObject.h>
#include <LibJS/Runtime/GlobalEnvironmentRecord.h>
#include <LibJS/Runtime/GlobalEnvironment.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/ObjectEnvironmentRecord.h>
#include <LibJS/Runtime/ObjectEnvironment.h>
#include <LibJS/Runtime/PropertyName.h>
#include <LibJS/Runtime/ProxyObject.h>
@ -148,21 +148,21 @@ Object* get_prototype_from_constructor(GlobalObject& global_object, FunctionObje
}
// 9.1.2.2 NewDeclarativeEnvironment ( E ), https://tc39.es/ecma262/#sec-newdeclarativeenvironment
DeclarativeEnvironmentRecord* new_declarative_environment(EnvironmentRecord& environment_record)
DeclarativeEnvironment* new_declarative_environment(Environment& environment)
{
auto& global_object = environment_record.global_object();
return global_object.heap().allocate<DeclarativeEnvironmentRecord>(global_object, &environment_record);
auto& global_object = environment.global_object();
return global_object.heap().allocate<DeclarativeEnvironment>(global_object, &environment);
}
// 9.1.2.3 NewObjectEnvironment ( O, W, E ), https://tc39.es/ecma262/#sec-newobjectenvironment
ObjectEnvironmentRecord* new_object_environment(Object& object, bool is_with_environment, EnvironmentRecord* environment_record)
ObjectEnvironment* new_object_environment(Object& object, bool is_with_environment, Environment* environment)
{
auto& global_object = object.global_object();
return global_object.heap().allocate<ObjectEnvironmentRecord>(global_object, object, is_with_environment ? ObjectEnvironmentRecord::IsWithEnvironment::Yes : ObjectEnvironmentRecord::IsWithEnvironment::No, environment_record);
return global_object.heap().allocate<ObjectEnvironment>(global_object, object, is_with_environment ? ObjectEnvironment::IsWithEnvironment::Yes : ObjectEnvironment::IsWithEnvironment::No, environment);
}
// 9.4.3 GetThisEnvironment ( ), https://tc39.es/ecma262/#sec-getthisenvironment
EnvironmentRecord& get_this_environment(VM& vm)
Environment& get_this_environment(VM& vm)
{
for (auto* env = vm.lexical_environment(); env; env = env->outer_environment()) {
if (env->has_this_binding())
@ -175,7 +175,7 @@ EnvironmentRecord& get_this_environment(VM& vm)
Object* get_super_constructor(VM& vm)
{
auto& env = get_this_environment(vm);
auto& active_function = verify_cast<FunctionEnvironmentRecord>(env).function_object();
auto& active_function = verify_cast<FunctionEnvironment>(env).function_object();
auto* super_constructor = active_function.prototype();
return super_constructor;
}
@ -202,7 +202,7 @@ Value perform_eval(Value x, GlobalObject& caller_realm, CallerMode strict_caller
if (direct == EvalMode::Direct)
return interpreter.execute_statement(caller_realm, program).value_or(js_undefined());
TemporaryChange scope_change(vm.running_execution_context().lexical_environment, static_cast<EnvironmentRecord*>(&caller_realm.environment_record()));
TemporaryChange scope_change(vm.running_execution_context().lexical_environment, static_cast<Environment*>(&caller_realm.environment()));
return interpreter.execute_statement(caller_realm, program).value_or(js_undefined());
}
@ -234,7 +234,7 @@ Object* create_unmapped_arguments_object(GlobalObject& global_object, Vector<Val
}
// 10.4.4.7 CreateMappedArgumentsObject ( func, formals, argumentsList, env ), https://tc39.es/ecma262/#sec-createmappedargumentsobject
Object* create_mapped_arguments_object(GlobalObject& global_object, FunctionObject& function, Vector<FunctionNode::Parameter> const& formals, Vector<Value> const& arguments, EnvironmentRecord&)
Object* create_mapped_arguments_object(GlobalObject& global_object, FunctionObject& function, Vector<FunctionNode::Parameter> const& formals, Vector<Value> const& arguments, Environment&)
{
// FIXME: This implementation is incomplete and doesn't support the actual identifier mappings yet.
(void)formals;