BooleanObject.h 567 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2020, Jack Karamanian <karamanian.jack@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/Object.h>
  8. namespace JS {
  9. class BooleanObject : public Object {
  10. JS_OBJECT(BooleanObject, Object);
  11. JS_DECLARE_ALLOCATOR(BooleanObject);
  12. public:
  13. static NonnullGCPtr<BooleanObject> create(Realm&, bool);
  14. virtual ~BooleanObject() override = default;
  15. bool boolean() const { return m_value; }
  16. protected:
  17. BooleanObject(bool, Object& prototype);
  18. private:
  19. bool m_value { false };
  20. };
  21. }