blob: f089e036c681a3f55b0444b81d19db33f36e714e [file] [log] [blame]
weinig@apple.comb54ef442008-06-29 19:53:42 +00001/*
2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
ggaren@apple.com19fe5092011-05-18 02:39:00 +00003 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
weinig@apple.comb54ef442008-06-29 19:53:42 +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
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.comf0ea3552008-07-01 01:11:22 +000024#include "InternalFunction.h"
weinig@apple.comb54ef442008-06-29 19:53:42 +000025
cwzwarich@webkit.org3f782f62008-09-08 01:28:33 +000026namespace JSC {
weinig@apple.comb54ef442008-06-29 19:53:42 +000027
28 class DatePrototype;
weinig@apple.comb54ef442008-06-29 19:53:42 +000029
weinig@apple.comb54ef442008-06-29 19:53:42 +000030 class DateConstructor : public InternalFunction {
oliver@apple.comfcacd3c2011-07-18 17:47:13 +000031 public:
commit-queue@webkit.org6c25c522011-08-09 20:46:17 +000032 typedef InternalFunction Base;
33
oliver@apple.comfcacd3c2011-07-18 17:47:13 +000034 static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
35 {
ggaren@apple.com215589e2011-12-19 17:45:13 +000036 DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
mhahnenberg@apple.com5e109722011-09-14 18:55:25 +000037 constructor->finishCreation(exec, datePrototype);
38 return constructor;
oliver@apple.comfcacd3c2011-07-18 17:47:13 +000039 }
ggaren@apple.com19fe5092011-05-18 02:39:00 +000040
41 static const ClassInfo s_info;
42
oliver@apple.comee1bdc82011-09-06 21:51:00 +000043 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
ggaren@apple.com19fe5092011-05-18 02:39:00 +000044 {
oliver@apple.com8c798d22011-09-11 21:11:11 +000045 return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
ggaren@apple.com19fe5092011-05-18 02:39:00 +000046 }
47
48 protected:
mhahnenberg@apple.com7317a7f2011-09-09 21:43:14 +000049 void finishCreation(ExecState*, DatePrototype*);
ggaren@apple.com19fe5092011-05-18 02:39:00 +000050 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
weinig@apple.com0e2d66e2008-07-06 05:26:58 +000051
weinig@apple.comb54ef442008-06-29 19:53:42 +000052 private:
mhahnenberg@apple.com5e109722011-09-14 18:55:25 +000053 DateConstructor(JSGlobalObject*, Structure*);
mhahnenberg@apple.com79c8e6e2011-10-08 23:26:41 +000054 static ConstructType getConstructData(JSCell*, ConstructData&);
mhahnenberg@apple.com2413eb82011-09-27 22:46:51 +000055 static CallType getCallData(JSCell*, CallData&);
ggaren@apple.com19fe5092011-05-18 02:39:00 +000056
barraclough@apple.com38d3c752012-05-12 00:39:43 +000057 static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
mhahnenberg@apple.com19869642011-10-08 21:31:32 +000058
barraclough@apple.com38d3c752012-05-12 00:39:43 +000059 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
weinig@apple.comb54ef442008-06-29 19:53:42 +000060 };
61
oliver@apple.comfff92222011-03-29 16:02:31 +000062 JSObject* constructDate(ExecState*, JSGlobalObject*, const ArgList&);
weinig@apple.com087f6ec2008-09-22 23:01:43 +000063
cwzwarich@webkit.org3f782f62008-09-08 01:28:33 +000064} // namespace JSC
weinig@apple.comb54ef442008-06-29 19:53:42 +000065
66#endif // DateConstructor_h