BigIntObject.cpp 679 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2020, 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. BigIntObject* BigIntObject::create(GlobalObject& global_object, BigInt& bigint)
  10. {
  11. return global_object.heap().allocate<BigIntObject>(global_object, bigint, *global_object.bigint_prototype());
  12. }
  13. BigIntObject::BigIntObject(BigInt& bigint, Object& prototype)
  14. : Object(prototype)
  15. , m_bigint(bigint)
  16. {
  17. }
  18. BigIntObject::~BigIntObject()
  19. {
  20. }
  21. void BigIntObject::visit_edges(Cell::Visitor& visitor)
  22. {
  23. Base::visit_edges(visitor);
  24. visitor.visit(&m_bigint);
  25. }
  26. }