kocienda | 66a6d36 | 2001-08-24 14:24:45 +0000 | [diff] [blame] | 1 | /* |
mjs | b98d772 | 2005-12-30 08:14:12 +0000 | [diff] [blame] | 2 | * Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org) |
darin@apple.com | a313ead | 2008-01-27 08:54:25 +0000 | [diff] [blame] | 3 | * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
kocienda | 66a6d36 | 2001-08-24 14:24:45 +0000 | [diff] [blame] | 4 | * |
| 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 |
aroben | 0a1af34 | 2007-10-25 01:19:50 +0000 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 18 | * USA |
mjs | 6f821c8 | 2002-03-22 00:31:57 +0000 | [diff] [blame] | 19 | * |
kocienda | 66a6d36 | 2001-08-24 14:24:45 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
mjs | b64c50a | 2005-10-03 21:13:12 +0000 | [diff] [blame] | 22 | #include "config.h" |
darin@apple.com | 5c0863d | 2008-06-16 04:17:44 +0000 | [diff] [blame] | 23 | #include "NumberObject.h" |
mjs | a09640f | 2006-01-29 04:12:59 +0000 | [diff] [blame] | 24 | |
weinig@apple.com | efdce0f | 2008-06-30 20:52:03 +0000 | [diff] [blame] | 25 | #include "JSGlobalObject.h" |
| 26 | #include "NumberPrototype.h" |
fpizlo@apple.com | fb7eff2 | 2014-02-11 01:45:50 +0000 | [diff] [blame] | 27 | #include "JSCInlines.h" |
weinig@apple.com | efdce0f | 2008-06-30 20:52:03 +0000 | [diff] [blame] | 28 | |
cwzwarich@webkit.org | 3f782f6 | 2008-09-08 01:28:33 +0000 | [diff] [blame] | 29 | namespace JSC { |
kocienda | 66a6d36 | 2001-08-24 14:24:45 +0000 | [diff] [blame] | 30 | |
andersca@apple.com | 7de5aae | 2013-09-05 20:12:23 +0000 | [diff] [blame] | 31 | STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(NumberObject); |
ggaren@apple.com | fea4353 | 2008-08-17 20:23:49 +0000 | [diff] [blame] | 32 | |
akling@apple.com | 2de49b7 | 2014-07-30 22:26:22 +0000 | [diff] [blame] | 33 | const ClassInfo NumberObject::s_info = { "Number", &JSWrapperObject::s_info, 0, CREATE_METHOD_TABLE(NumberObject) }; |
mjs | 6f821c8 | 2002-03-22 00:31:57 +0000 | [diff] [blame] | 34 | |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 35 | NumberObject::NumberObject(VM& vm, Structure* structure) |
| 36 | : JSWrapperObject(vm, structure) |
kocienda | 66a6d36 | 2001-08-24 14:24:45 +0000 | [diff] [blame] | 37 | { |
commit-queue@webkit.org | 6e5671b | 2011-09-01 23:49:23 +0000 | [diff] [blame] | 38 | } |
| 39 | |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 40 | void NumberObject::finishCreation(VM& vm) |
commit-queue@webkit.org | 6e5671b | 2011-09-01 23:49:23 +0000 | [diff] [blame] | 41 | { |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 42 | Base::finishCreation(vm); |
fpizlo@apple.com | 10ae2d0 | 2013-08-14 02:41:47 +0000 | [diff] [blame] | 43 | ASSERT(inherits(info())); |
mjs | 6f821c8 | 2002-03-22 00:31:57 +0000 | [diff] [blame] | 44 | } |
weinig@apple.com | 415e1c52 | 2008-01-17 19:27:33 +0000 | [diff] [blame] | 45 | |
oliver@apple.com | 3b6dc57 | 2011-03-28 23:39:16 +0000 | [diff] [blame] | 46 | NumberObject* constructNumber(ExecState* exec, JSGlobalObject* globalObject, JSValue number) |
weinig@apple.com | efdce0f | 2008-06-30 20:52:03 +0000 | [diff] [blame] | 47 | { |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 48 | NumberObject* object = NumberObject::create(exec->vm(), globalObject->numberObjectStructure()); |
| 49 | object->setInternalValue(exec->vm(), number); |
darin@apple.com | 8281d83 | 2008-09-21 02:29:12 +0000 | [diff] [blame] | 50 | return object; |
weinig@apple.com | efdce0f | 2008-06-30 20:52:03 +0000 | [diff] [blame] | 51 | } |
| 52 | |
cwzwarich@webkit.org | 3f782f6 | 2008-09-08 01:28:33 +0000 | [diff] [blame] | 53 | } // namespace JSC |