BigIntObject.h 700 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/BigInt.h>
  8. #include <LibJS/Runtime/Object.h>
  9. namespace JS {
  10. class BigIntObject final : public Object {
  11. JS_OBJECT(BigIntObject, Object);
  12. JS_DECLARE_ALLOCATOR(BigIntObject);
  13. public:
  14. static NonnullGCPtr<BigIntObject> create(Realm&, BigInt&);
  15. virtual ~BigIntObject() override = default;
  16. BigInt const& bigint() const { return m_bigint; }
  17. BigInt& bigint() { return m_bigint; }
  18. private:
  19. BigIntObject(BigInt&, Object& prototype);
  20. virtual void visit_edges(Visitor&) override;
  21. NonnullGCPtr<BigInt> m_bigint;
  22. };
  23. }