summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Map.cpp
blob: e5c0a59a5f61c059a7c11aeebbfbb0ffe9399e36 (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
30
31
32
33
34
/*
 * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibJS/Runtime/Map.h>

namespace JS {

Map* Map::create(GlobalObject& global_object)
{
    return global_object.heap().allocate<Map>(global_object, *global_object.map_prototype());
}

Map::Map(Object& prototype)
    : Object(prototype)
{
}

Map::~Map()
{
}

void Map::visit_edges(Cell::Visitor& visitor)
{
    Base::visit_edges(visitor);
    for (auto& value : m_entries) {
        visitor.visit(value.key);
        visitor.visit(value.value);
    }
}

}