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 {
|
|
|
|
|
|
2020-04-17 13:55:53 -03:00
|
|
|
NumberObject* NumberObject::create(GlobalObject& global_object, double value)
|
|
|
|
|
{
|
2020-06-20 10:40:48 -03:00
|
|
|
return global_object.heap().allocate<NumberObject>(global_object, value, *global_object.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
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NumberObject::~NumberObject()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|