BooleanObject.h 508 B

12345678910111213141516171819202122232425262728
  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. public:
  12. static BooleanObject* create(GlobalObject&, bool);
  13. BooleanObject(bool, Object& prototype);
  14. virtual ~BooleanObject() override = default;
  15. bool boolean() const { return m_value; }
  16. private:
  17. bool m_value { false };
  18. };
  19. }