ladybird/Libraries/LibJS/Runtime/BooleanObject.h

32 lines
562 B
C
Raw Normal View History

2020-04-06 22:51:16 -05:00
/*
* Copyright (c) 2020, Jack Karamanian <karamanian.jack@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
2020-04-06 22:51:16 -05:00
*/
#pragma once
#include <LibJS/Runtime/Object.h>
namespace JS {
2020-04-06 22:51:16 -05:00
class BooleanObject : public Object {
JS_OBJECT(BooleanObject, Object);
GC_DECLARE_ALLOCATOR(BooleanObject);
2020-04-06 22:51:16 -05:00
public:
static GC::Ref<BooleanObject> create(Realm&, bool);
virtual ~BooleanObject() override = default;
2020-04-06 22:51:16 -05:00
bool boolean() const { return m_value; }
2020-04-06 22:51:16 -05:00
protected:
BooleanObject(bool, Object& prototype);
2020-04-06 22:51:16 -05:00
private:
bool m_value { false };
};
2020-04-06 22:51:16 -05:00
}