BooleanObject.h 526 B

123456789101112131415161718192021222324252627282930
  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 NonnullGCPtr<BooleanObject> create(Realm&, bool);
  13. virtual ~BooleanObject() override = default;
  14. bool boolean() const { return m_value; }
  15. protected:
  16. BooleanObject(bool, Object& prototype);
  17. private:
  18. bool m_value { false };
  19. };
  20. }