
"Records" in the spec are basically C++ classes, so let's drop this mouthful of a suffix.
29 lines
575 B
C++
29 lines
575 B
C++
/*
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibJS/Runtime/Environment.h>
|
|
#include <LibJS/Runtime/VM.h>
|
|
|
|
namespace JS {
|
|
|
|
Environment::Environment(Environment* outer_environment)
|
|
: m_outer_environment(outer_environment)
|
|
{
|
|
}
|
|
|
|
void Environment::initialize(GlobalObject& global_object)
|
|
{
|
|
m_global_object = &global_object;
|
|
Cell::initialize(global_object);
|
|
}
|
|
|
|
void Environment::visit_edges(Visitor& visitor)
|
|
{
|
|
Cell::visit_edges(visitor);
|
|
visitor.visit(m_outer_environment);
|
|
}
|
|
|
|
}
|