2020-04-04 23:13:13 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
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 {
|
|
|
|
|
2022-08-16 00:20:49 +01:00
|
|
|
NumberObject* NumberObject::create(Realm& realm, double value)
|
2020-04-17 18:55:53 +02:00
|
|
|
{
|
2022-08-27 00:54:55 +01:00
|
|
|
return realm.heap().allocate<NumberObject>(realm, value, *realm.intrinsics().number_prototype());
|
2020-04-17 18:55:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
NumberObject::NumberObject(double value, Object& prototype)
|
2020-06-23 17:21:53 +02:00
|
|
|
: Object(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
|
|
|
}
|