2020-06-06 01:14:10 +01:00
|
|
|
/*
|
2021-04-22 22:51:19 +02:00
|
|
|
* Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
|
2020-06-06 01:14:10 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-06 01:14:10 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/BigIntObject.h>
|
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
2022-08-16 00:20:49 +01:00
|
|
|
BigIntObject* BigIntObject::create(Realm& realm, BigInt& bigint)
|
2020-06-06 01:14:10 +01:00
|
|
|
{
|
2022-08-16 00:20:50 +01:00
|
|
|
return realm.heap().allocate<BigIntObject>(realm, bigint, *realm.global_object().bigint_prototype());
|
2020-06-06 01:14:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
|
2020-06-23 17:21:53 +02:00
|
|
|
: Object(prototype)
|
2020-06-06 01:14:10 +01:00
|
|
|
, m_bigint(bigint)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-11-28 14:33:36 +01:00
|
|
|
void BigIntObject::visit_edges(Cell::Visitor& visitor)
|
2020-06-06 01:14:10 +01:00
|
|
|
{
|
2021-09-11 14:05:12 +02:00
|
|
|
Base::visit_edges(visitor);
|
2020-06-06 01:14:10 +01:00
|
|
|
visitor.visit(&m_bigint);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|