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