2020-04-07 03:51:16 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Jack Karamanian <karamanian.jack@gmail.com>
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-07 03:51:16 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/BooleanObject.h>
|
2020-04-17 17:03:52 +00:00
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
2020-04-07 03:51:16 +00:00
|
|
|
|
|
|
|
namespace JS {
|
2020-04-10 11:04:12 +00:00
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
GC_DEFINE_ALLOCATOR(BooleanObject);
|
2023-11-19 08:45:05 +00:00
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
GC::Ref<BooleanObject> BooleanObject::create(Realm& realm, bool value)
|
2020-04-17 17:03:52 +00:00
|
|
|
{
|
2024-11-13 16:50:17 +00:00
|
|
|
return realm.create<BooleanObject>(value, realm.intrinsics().boolean_prototype());
|
2020-04-17 17:03:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BooleanObject::BooleanObject(bool value, Object& prototype)
|
2022-12-14 11:17:58 +00:00
|
|
|
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
2020-04-18 08:27:57 +00:00
|
|
|
, m_value(value)
|
2020-04-07 03:51:16 +00:00
|
|
|
{
|
|
|
|
}
|
2022-04-17 20:59:52 +00:00
|
|
|
|
2020-04-07 03:51:16 +00:00
|
|
|
}
|