weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) |
ggaren@apple.com | 19fe509 | 2011-05-18 02:39:00 +0000 | [diff] [blame] | 3 | * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +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 |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #ifndef DateConstructor_h |
| 22 | #define DateConstructor_h |
| 23 | |
weinig@apple.com | f0ea355 | 2008-07-01 01:11:22 +0000 | [diff] [blame] | 24 | #include "InternalFunction.h" |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 25 | |
cwzwarich@webkit.org | 3f782f6 | 2008-09-08 01:28:33 +0000 | [diff] [blame] | 26 | namespace JSC { |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 27 | |
| 28 | class DatePrototype; |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 29 | |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 30 | class DateConstructor : public InternalFunction { |
oliver@apple.com | fcacd3c | 2011-07-18 17:47:13 +0000 | [diff] [blame] | 31 | public: |
commit-queue@webkit.org | 6c25c52 | 2011-08-09 20:46:17 +0000 | [diff] [blame] | 32 | typedef InternalFunction Base; |
| 33 | |
oliver@apple.com | fcacd3c | 2011-07-18 17:47:13 +0000 | [diff] [blame] | 34 | static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype) |
| 35 | { |
ggaren@apple.com | 215589e | 2011-12-19 17:45:13 +0000 | [diff] [blame] | 36 | DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure); |
mhahnenberg@apple.com | 5e10972 | 2011-09-14 18:55:25 +0000 | [diff] [blame] | 37 | constructor->finishCreation(exec, datePrototype); |
| 38 | return constructor; |
oliver@apple.com | fcacd3c | 2011-07-18 17:47:13 +0000 | [diff] [blame] | 39 | } |
ggaren@apple.com | 19fe509 | 2011-05-18 02:39:00 +0000 | [diff] [blame] | 40 | |
| 41 | static const ClassInfo s_info; |
| 42 | |
oliver@apple.com | ee1bdc8 | 2011-09-06 21:51:00 +0000 | [diff] [blame] | 43 | static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) |
ggaren@apple.com | 19fe509 | 2011-05-18 02:39:00 +0000 | [diff] [blame] | 44 | { |
oliver@apple.com | 8c798d2 | 2011-09-11 21:11:11 +0000 | [diff] [blame] | 45 | return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); |
ggaren@apple.com | 19fe509 | 2011-05-18 02:39:00 +0000 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | protected: |
mhahnenberg@apple.com | 7317a7f | 2011-09-09 21:43:14 +0000 | [diff] [blame] | 49 | void finishCreation(ExecState*, DatePrototype*); |
ggaren@apple.com | 19fe509 | 2011-05-18 02:39:00 +0000 | [diff] [blame] | 50 | static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; |
weinig@apple.com | 0e2d66e | 2008-07-06 05:26:58 +0000 | [diff] [blame] | 51 | |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 52 | private: |
mhahnenberg@apple.com | 5e10972 | 2011-09-14 18:55:25 +0000 | [diff] [blame] | 53 | DateConstructor(JSGlobalObject*, Structure*); |
mhahnenberg@apple.com | 79c8e6e | 2011-10-08 23:26:41 +0000 | [diff] [blame] | 54 | static ConstructType getConstructData(JSCell*, ConstructData&); |
mhahnenberg@apple.com | 2413eb8 | 2011-09-27 22:46:51 +0000 | [diff] [blame] | 55 | static CallType getCallData(JSCell*, CallData&); |
ggaren@apple.com | 19fe509 | 2011-05-18 02:39:00 +0000 | [diff] [blame] | 56 | |
barraclough@apple.com | 38d3c75 | 2012-05-12 00:39:43 +0000 | [diff] [blame] | 57 | static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); |
mhahnenberg@apple.com | 1986964 | 2011-10-08 21:31:32 +0000 | [diff] [blame] | 58 | |
barraclough@apple.com | 38d3c75 | 2012-05-12 00:39:43 +0000 | [diff] [blame] | 59 | static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 60 | }; |
| 61 | |
oliver@apple.com | fff9222 | 2011-03-29 16:02:31 +0000 | [diff] [blame] | 62 | JSObject* constructDate(ExecState*, JSGlobalObject*, const ArgList&); |
weinig@apple.com | 087f6ec | 2008-09-22 23:01:43 +0000 | [diff] [blame] | 63 | |
cwzwarich@webkit.org | 3f782f6 | 2008-09-08 01:28:33 +0000 | [diff] [blame] | 64 | } // namespace JSC |
weinig@apple.com | b54ef44 | 2008-06-29 19:53:42 +0000 | [diff] [blame] | 65 | |
| 66 | #endif // DateConstructor_h |