2020-04-04 23:13:13 +02:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2020-04-04 23:13:13 +02:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-04 23:13:13 +02:00
|
|
|
*/
|
|
|
|
|
2020-04-17 18:55:53 +02:00
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
2020-04-04 23:13:13 +02:00
|
|
|
#include <LibJS/Runtime/NumberObject.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(NumberObject);
|
2023-11-19 09:45:05 +01:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<NumberObject> NumberObject::create(Realm& realm, double value)
|
2020-04-17 18:55:53 +02:00
|
|
|
{
|
2024-11-14 05:50:17 +13:00
|
|
|
return realm.create<NumberObject>(value, realm.intrinsics().number_prototype());
|
2020-04-17 18:55:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
NumberObject::NumberObject(double value, Object& prototype)
|
2022-12-14 12:17:58 +01:00
|
|
|
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
2020-04-18 10:27:57 +02:00
|
|
|
, m_value(value)
|
2020-04-04 23:13:13 +02:00
|
|
|
{
|
|
|
|
}
|
2022-04-17 22:59:52 +02:00
|
|
|
|
2020-04-04 23:13:13 +02:00
|
|
|
}
|