BigIntObject.cpp 666 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2020-2023, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/BigIntObject.h>
  7. #include <LibJS/Runtime/GlobalObject.h>
  8. namespace JS {
  9. NonnullGCPtr<BigIntObject> BigIntObject::create(Realm& realm, BigInt& bigint)
  10. {
  11. return realm.heap().allocate<BigIntObject>(realm, bigint, realm.intrinsics().bigint_prototype());
  12. }
  13. BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
  14. : Object(ConstructWithPrototypeTag::Tag, prototype)
  15. , m_bigint(bigint)
  16. {
  17. }
  18. void BigIntObject::visit_edges(Cell::Visitor& visitor)
  19. {
  20. Base::visit_edges(visitor);
  21. visitor.visit(m_bigint);
  22. }
  23. }