mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibJS: Rename ScriptFunction::m_parent_scope => m_environment
This is for the [[Environment]] slot so let's have a matching name. :^)
This commit is contained in:
parent
667bba2410
commit
d436d6d565
2 changed files with 7 additions and 7 deletions
|
@ -55,7 +55,7 @@ ScriptFunction::ScriptFunction(GlobalObject& global_object, const FlyString& nam
|
|||
, m_name(name)
|
||||
, m_body(body)
|
||||
, m_parameters(move(parameters))
|
||||
, m_parent_scope(parent_scope)
|
||||
, m_environment(parent_scope)
|
||||
, m_function_length(function_length)
|
||||
, m_kind(kind)
|
||||
, m_is_strict(is_strict)
|
||||
|
@ -98,7 +98,7 @@ ScriptFunction::~ScriptFunction()
|
|||
void ScriptFunction::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Function::visit_edges(visitor);
|
||||
visitor.visit(m_parent_scope);
|
||||
visitor.visit(m_environment);
|
||||
}
|
||||
|
||||
FunctionEnvironmentRecord* ScriptFunction::create_environment_record(Function& function_being_invoked)
|
||||
|
@ -130,11 +130,11 @@ FunctionEnvironmentRecord* ScriptFunction::create_environment_record(Function& f
|
|||
}
|
||||
}
|
||||
|
||||
auto* environment = heap().allocate<FunctionEnvironmentRecord>(global_object(), m_parent_scope, variables);
|
||||
auto* environment = heap().allocate<FunctionEnvironmentRecord>(global_object(), m_environment, variables);
|
||||
environment->set_function_object(function_being_invoked);
|
||||
if (m_is_arrow_function) {
|
||||
if (is<FunctionEnvironmentRecord>(m_parent_scope))
|
||||
environment->set_new_target(static_cast<FunctionEnvironmentRecord*>(m_parent_scope)->new_target());
|
||||
if (is<FunctionEnvironmentRecord>(m_environment))
|
||||
environment->set_new_target(static_cast<FunctionEnvironmentRecord*>(m_environment)->new_target());
|
||||
}
|
||||
return environment;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
auto& bytecode_executable() const { return m_bytecode_executable; }
|
||||
|
||||
virtual EnvironmentRecord* environment() override { return m_parent_scope; }
|
||||
virtual EnvironmentRecord* environment() override { return m_environment; }
|
||||
|
||||
protected:
|
||||
virtual bool is_strict_mode() const final { return m_is_strict; }
|
||||
|
@ -53,7 +53,7 @@ private:
|
|||
NonnullRefPtr<Statement> m_body;
|
||||
const Vector<FunctionNode::Parameter> m_parameters;
|
||||
Optional<Bytecode::Executable> m_bytecode_executable;
|
||||
EnvironmentRecord* m_parent_scope { nullptr };
|
||||
EnvironmentRecord* m_environment { nullptr };
|
||||
i32 m_function_length { 0 };
|
||||
FunctionKind m_kind { FunctionKind::Regular };
|
||||
bool m_is_strict { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue