1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

LibJS: Rename Environment Records so they match the spec :^)

This patch makes the following name changes:

- ScopeObject => EnvironmentRecord
- LexicalEnvironment => DeclarativeEnvironmentRecord
- WithScope => ObjectEnvironmentRecord
This commit is contained in:
Andreas Kling 2021-06-21 23:17:24 +02:00
parent e9b4a0a830
commit 6c6dbcfc36
35 changed files with 297 additions and 297 deletions

View file

@ -12,11 +12,11 @@
#include <LibJS/Bytecode/Op.h>
#include <LibJS/Runtime/Array.h>
#include <LibJS/Runtime/BigInt.h>
#include <LibJS/Runtime/DeclarativeEnvironmentRecord.h>
#include <LibJS/Runtime/EnvironmentRecord.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/IteratorOperations.h>
#include <LibJS/Runtime/LexicalEnvironment.h>
#include <LibJS/Runtime/RegExpObject.h>
#include <LibJS/Runtime/ScopeObject.h>
#include <LibJS/Runtime/ScriptFunction.h>
#include <LibJS/Runtime/Value.h>
@ -381,13 +381,13 @@ void ContinuePendingUnwind::replace_references_impl(BasicBlock const& from, Basi
m_resume_target = Label { to };
}
void PushLexicalEnvironment::execute_impl(Bytecode::Interpreter& interpreter) const
void PushDeclarativeEnvironmentRecord::execute_impl(Bytecode::Interpreter& interpreter) const
{
HashMap<FlyString, Variable> resolved_variables;
for (auto& it : m_variables)
resolved_variables.set(interpreter.current_executable().get_string(it.key), it.value);
auto* block_lexical_environment = interpreter.vm().heap().allocate<LexicalEnvironment>(interpreter.global_object(), move(resolved_variables), interpreter.vm().current_scope());
interpreter.vm().call_frame().scope = block_lexical_environment;
auto* environment_record = interpreter.vm().heap().allocate<DeclarativeEnvironmentRecord>(interpreter.global_object(), move(resolved_variables), interpreter.vm().current_scope());
interpreter.vm().call_frame().environment_record = environment_record;
}
void Yield::execute_impl(Bytecode::Interpreter& interpreter) const
@ -639,10 +639,10 @@ String ContinuePendingUnwind::to_string_impl(Bytecode::Executable const&) const
return String::formatted("ContinuePendingUnwind resume:{}", m_resume_target);
}
String PushLexicalEnvironment::to_string_impl(const Bytecode::Executable& executable) const
String PushDeclarativeEnvironmentRecord::to_string_impl(const Bytecode::Executable& executable) const
{
StringBuilder builder;
builder.append("PushLexicalEnvironment");
builder.append("PushDeclarativeEnvironmentRecord");
if (!m_variables.is_empty()) {
builder.append(" {");
Vector<String> names;