2020-04-06 22:51:16 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Jack Karamanian <karamanian.jack@gmail.com>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-06 22:51:16 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
|
|
|
|
namespace JS {
|
2022-04-17 22:59:52 +02:00
|
|
|
|
2020-04-06 22:51:16 -05:00
|
|
|
class BooleanObject : public Object {
|
2020-06-21 15:14:02 +02:00
|
|
|
JS_OBJECT(BooleanObject, Object);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(BooleanObject);
|
2020-06-21 15:14:02 +02:00
|
|
|
|
2020-04-06 22:51:16 -05:00
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
static GC::Ref<BooleanObject> create(Realm&, bool);
|
2020-04-17 19:03:52 +02:00
|
|
|
|
2022-03-14 10:25:06 -06:00
|
|
|
virtual ~BooleanObject() override = default;
|
2020-04-06 22:51:16 -05:00
|
|
|
|
2021-12-10 22:50:02 +00:00
|
|
|
bool boolean() const { return m_value; }
|
2020-04-06 22:51:16 -05:00
|
|
|
|
2022-08-28 23:51:28 +02:00
|
|
|
protected:
|
|
|
|
BooleanObject(bool, Object& prototype);
|
|
|
|
|
2020-04-06 22:51:16 -05:00
|
|
|
private:
|
|
|
|
bool m_value { false };
|
|
|
|
};
|
2022-04-17 22:59:52 +02:00
|
|
|
|
2020-04-06 22:51:16 -05:00
|
|
|
}
|