BigIntObject.h 706 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2020, 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. public:
  13. static BigIntObject* create(GlobalObject&, BigInt&);
  14. BigIntObject(BigInt&, Object& prototype);
  15. virtual ~BigIntObject();
  16. BigInt const& bigint() const { return m_bigint; }
  17. BigInt& bigint() { return m_bigint; }
  18. virtual Value value_of() const override
  19. {
  20. return Value(&m_bigint);
  21. }
  22. private:
  23. virtual void visit_edges(Visitor&) override;
  24. BigInt& m_bigint;
  25. };
  26. }