2021-06-08 18: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 {
|
|
|
|
|
|
2022-08-15 20:20:49 -03:00
|
|
|
Set* Set::create(Realm& realm)
|
2021-06-08 18:08:47 -03:00
|
|
|
{
|
2022-08-26 20:54:55 -03:00
|
|
|
return realm.heap().allocate<Set>(realm, *realm.intrinsics().set_prototype());
|
2021-06-08 18:08:47 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Set::Set(Object& prototype)
|
|
|
|
|
: Object(prototype)
|
2022-08-26 20:54:55 -03:00
|
|
|
, m_values(*prototype.shape().realm().intrinsics().map_prototype())
|
2021-06-08 18:08:47 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-09 12:01:06 -03:00
|
|
|
void Set::visit_edges(Cell::Visitor& visitor)
|
|
|
|
|
{
|
2021-09-11 09:05:12 -03:00
|
|
|
Base::visit_edges(visitor);
|
2022-02-09 12:04:16 -03:00
|
|
|
static_cast<Object&>(m_values).visit_edges(visitor);
|
2021-06-09 12:01:06 -03:00
|
|
|
}
|
|
|
|
|
|
2021-06-08 18:08:47 -03:00
|
|
|
}
|