BooleanObject.h 538 B

1234567891011121314151617181920212223242526272829
  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;
  15. virtual Value value_of() const override
  16. {
  17. return Value(m_value);
  18. }
  19. private:
  20. bool m_value { false };
  21. };
  22. }