BigIntObject.cpp 644 B

1234567891011121314151617181920212223242526272829
  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. void BigIntObject::visit_edges(Cell::Visitor& visitor)
  19. {
  20. Base::visit_edges(visitor);
  21. visitor.visit(&m_bigint);
  22. }
  23. }