ladybird/Userland/Libraries/LibJS/Runtime/Set.cpp

29 lines
548 B
C++
Raw Normal View History

2021-06-09 00:08:47 +03:00
/*
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/Set.h>
namespace JS {
Set* Set::create(Realm& realm)
2021-06-09 00:08:47 +03:00
{
return realm.heap().allocate<Set>(realm, *realm.global_object().set_prototype());
2021-06-09 00:08:47 +03:00
}
Set::Set(Object& prototype)
: Object(prototype)
, m_values(*prototype.global_object().map_prototype())
2021-06-09 00:08:47 +03:00
{
}
void Set::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
static_cast<Object&>(m_values).visit_edges(visitor);
}
2021-06-09 00:08:47 +03:00
}