
This is a continuation of the previous three commits. Now that create() receives the allocating realm, we can simply forward that to allocate(), which accounts for the majority of these changes. Additionally, we can get rid of the realm_from_global_object() in one place, with one more remaining in VM::throw_completion().
29 lines
621 B
C++
29 lines
621 B
C++
/*
|
|
* Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibJS/Runtime/BigIntObject.h>
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
|
|
|
namespace JS {
|
|
|
|
BigIntObject* BigIntObject::create(Realm& realm, BigInt& bigint)
|
|
{
|
|
return realm.heap().allocate<BigIntObject>(realm, bigint, *realm.global_object().bigint_prototype());
|
|
}
|
|
|
|
BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
|
|
: Object(prototype)
|
|
, m_bigint(bigint)
|
|
{
|
|
}
|
|
|
|
void BigIntObject::visit_edges(Cell::Visitor& visitor)
|
|
{
|
|
Base::visit_edges(visitor);
|
|
visitor.visit(&m_bigint);
|
|
}
|
|
|
|
}
|