blob: 31350ccbd17009831cf08b40a01cdaec680b2870 [file] [log] [blame]
kocienda66a6d362001-08-24 14:24:45 +00001/*
mjsb98d7722005-12-30 08:14:12 +00002 * Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org)
darin@apple.coma313ead2008-01-27 08:54:25 +00003 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
kocienda66a6d362001-08-24 14:24:45 +00004 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
aroben0a1af342007-10-25 01:19:50 +000017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18 * USA
mjs6f821c82002-03-22 00:31:57 +000019 *
kocienda66a6d362001-08-24 14:24:45 +000020 */
21
mjsb64c50a2005-10-03 21:13:12 +000022#include "config.h"
darin@apple.com5c0863d2008-06-16 04:17:44 +000023#include "NumberObject.h"
mjsa09640f2006-01-29 04:12:59 +000024
weinig@apple.comefdce0f2008-06-30 20:52:03 +000025#include "JSGlobalObject.h"
26#include "NumberPrototype.h"
fpizlo@apple.comfb7eff22014-02-11 01:45:50 +000027#include "JSCInlines.h"
weinig@apple.comefdce0f2008-06-30 20:52:03 +000028
cwzwarich@webkit.org3f782f62008-09-08 01:28:33 +000029namespace JSC {
kocienda66a6d362001-08-24 14:24:45 +000030
andersca@apple.com7de5aae2013-09-05 20:12:23 +000031STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(NumberObject);
ggaren@apple.comfea43532008-08-17 20:23:49 +000032
akling@apple.com2de49b72014-07-30 22:26:22 +000033const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, CREATE_METHOD_TABLE(NumberObject) };
mjs6f821c82002-03-22 00:31:57 +000034
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000035NumberObject::NumberObject(VM& vm, Structure* structure)
36 : JSWrapperObject(vm, structure)
kocienda66a6d362001-08-24 14:24:45 +000037{
commit-queue@webkit.org6e5671b2011-09-01 23:49:23 +000038}
39
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000040void NumberObject::finishCreation(VM& vm)
commit-queue@webkit.org6e5671b2011-09-01 23:49:23 +000041{
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000042 Base::finishCreation(vm);
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000043 ASSERT(inherits(info()));
mjs6f821c82002-03-22 00:31:57 +000044}
weinig@apple.com415e1c522008-01-17 19:27:33 +000045
oliver@apple.com3b6dc572011-03-28 23:39:16 +000046NumberObject* constructNumber(ExecState* exec, JSGlobalObject* globalObject, JSValue number)
weinig@apple.comefdce0f2008-06-30 20:52:03 +000047{
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000048 NumberObject* object = NumberObject::create(exec->vm(), globalObject->numberObjectStructure());
49 object->setInternalValue(exec->vm(), number);
darin@apple.com8281d832008-09-21 02:29:12 +000050 return object;
weinig@apple.comefdce0f2008-06-30 20:52:03 +000051}
52
cwzwarich@webkit.org3f782f62008-09-08 01:28:33 +000053} // namespace JSC