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