BigIntObject.h 663 B

1234567891011121314151617181920212223242526272829303132333435
  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. const BigInt& bigint() const { return m_bigint; }
  17. virtual Value value_of() const override
  18. {
  19. return Value(&m_bigint);
  20. }
  21. private:
  22. virtual void visit_edges(Visitor&) override;
  23. BigInt& m_bigint;
  24. };
  25. }