2020-04-04 21:13:13 +00:00
|
|
|
/*
|
2024-10-04 11:19:50 +00:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2020-04-04 21:13:13 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-04 21:13:13 +00:00
|
|
|
*/
|
|
|
|
|
2020-04-17 16:55:53 +00:00
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
2020-04-04 21:13:13 +00:00
|
|
|
#include <LibJS/Runtime/NumberObject.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
GC_DEFINE_ALLOCATOR(NumberObject);
|
2023-11-19 08:45:05 +00:00
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
GC::Ref<NumberObject> NumberObject::create(Realm& realm, double value)
|
2020-04-17 16:55:53 +00:00
|
|
|
{
|
2024-11-13 16:50:17 +00:00
|
|
|
return realm.create<NumberObject>(value, realm.intrinsics().number_prototype());
|
2020-04-17 16:55:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NumberObject::NumberObject(double 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-04 21:13:13 +00:00
|
|
|
{
|
|
|
|
}
|
2022-04-17 20:59:52 +00:00
|
|
|
|
2020-04-04 21:13:13 +00:00
|
|
|
}
|