2020-06-05 21:14:10 -03:00
|
|
|
/*
|
2023-04-12 19:47:15 -03:00
|
|
|
* Copyright (c) 2020-2023, Linus Groh <linusg@serenityos.org>
|
2020-06-05 21:14:10 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-05 21:14:10 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/BigIntObject.h>
|
|
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
|
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DEFINE_ALLOCATOR(BigIntObject);
|
2023-11-19 05:45:05 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ref<BigIntObject> BigIntObject::create(Realm& realm, BigInt& bigint)
|
2020-06-05 21:14:10 -03:00
|
|
|
{
|
2024-11-13 13:50:17 -03:00
|
|
|
return realm.create<BigIntObject>(bigint, realm.intrinsics().bigint_prototype());
|
2020-06-05 21:14:10 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
|
2022-12-14 08:17:58 -03:00
|
|
|
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
2020-06-05 21:14:10 -03:00
|
|
|
, m_bigint(bigint)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-28 10:33:36 -03:00
|
|
|
void BigIntObject::visit_edges(Cell::Visitor& visitor)
|
2020-06-05 21:14:10 -03:00
|
|
|
{
|
2021-09-11 09:05:12 -03:00
|
|
|
Base::visit_edges(visitor);
|
2023-02-26 20:09:02 -03:00
|
|
|
visitor.visit(m_bigint);
|
2020-06-05 21:14:10 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|