summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Environment.cpp
blob: 37722c06a30357a742a5e7613a358c52dd50ef88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * 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);
}

}