|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library 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 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 #include "JSCustomEvent.h" |
|
23 |
|
24 #include "CustomEvent.h" |
|
25 #include <runtime/Error.h> |
|
26 #include <wtf/GetPtr.h> |
|
27 |
|
28 using namespace JSC; |
|
29 |
|
30 namespace WebCore { |
|
31 |
|
32 ASSERT_CLASS_FITS_IN_CELL(JSCustomEvent); |
|
33 |
|
34 /* Hash table */ |
|
35 #if ENABLE(JIT) |
|
36 #define THUNK_GENERATOR(generator) , generator |
|
37 #else |
|
38 #define THUNK_GENERATOR(generator) |
|
39 #endif |
|
40 |
|
41 static const HashTableValue JSCustomEventTableValues[3] = |
|
42 { |
|
43 { "detail", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCustomEventDetail), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
44 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCustomEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
45 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
46 }; |
|
47 |
|
48 #undef THUNK_GENERATOR |
|
49 static JSC_CONST_HASHTABLE HashTable JSCustomEventTable = { 4, 3, JSCustomEventTableValues, 0 }; |
|
50 /* Hash table for constructor */ |
|
51 #if ENABLE(JIT) |
|
52 #define THUNK_GENERATOR(generator) , generator |
|
53 #else |
|
54 #define THUNK_GENERATOR(generator) |
|
55 #endif |
|
56 |
|
57 static const HashTableValue JSCustomEventConstructorTableValues[1] = |
|
58 { |
|
59 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
60 }; |
|
61 |
|
62 #undef THUNK_GENERATOR |
|
63 static JSC_CONST_HASHTABLE HashTable JSCustomEventConstructorTable = { 1, 0, JSCustomEventConstructorTableValues, 0 }; |
|
64 class JSCustomEventConstructor : public DOMConstructorObject { |
|
65 public: |
|
66 JSCustomEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
67 |
|
68 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
69 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
70 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
71 static const JSC::ClassInfo s_info; |
|
72 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
73 { |
|
74 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
75 } |
|
76 protected: |
|
77 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
78 }; |
|
79 |
|
80 const ClassInfo JSCustomEventConstructor::s_info = { "CustomEventConstructor", 0, &JSCustomEventConstructorTable, 0 }; |
|
81 |
|
82 JSCustomEventConstructor::JSCustomEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
83 : DOMConstructorObject(JSCustomEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
84 { |
|
85 putDirect(exec->propertyNames().prototype, JSCustomEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
86 } |
|
87 |
|
88 bool JSCustomEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
89 { |
|
90 return getStaticValueSlot<JSCustomEventConstructor, DOMObject>(exec, &JSCustomEventConstructorTable, this, propertyName, slot); |
|
91 } |
|
92 |
|
93 bool JSCustomEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
94 { |
|
95 return getStaticValueDescriptor<JSCustomEventConstructor, DOMObject>(exec, &JSCustomEventConstructorTable, this, propertyName, descriptor); |
|
96 } |
|
97 |
|
98 /* Hash table for prototype */ |
|
99 #if ENABLE(JIT) |
|
100 #define THUNK_GENERATOR(generator) , generator |
|
101 #else |
|
102 #define THUNK_GENERATOR(generator) |
|
103 #endif |
|
104 |
|
105 static const HashTableValue JSCustomEventPrototypeTableValues[2] = |
|
106 { |
|
107 { "initCustomEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCustomEventPrototypeFunctionInitCustomEvent), (intptr_t)4 THUNK_GENERATOR(0) }, |
|
108 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
109 }; |
|
110 |
|
111 #undef THUNK_GENERATOR |
|
112 static JSC_CONST_HASHTABLE HashTable JSCustomEventPrototypeTable = { 2, 1, JSCustomEventPrototypeTableValues, 0 }; |
|
113 const ClassInfo JSCustomEventPrototype::s_info = { "CustomEventPrototype", 0, &JSCustomEventPrototypeTable, 0 }; |
|
114 |
|
115 JSObject* JSCustomEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
116 { |
|
117 return getDOMPrototype<JSCustomEvent>(exec, globalObject); |
|
118 } |
|
119 |
|
120 bool JSCustomEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
121 { |
|
122 return getStaticFunctionSlot<JSObject>(exec, &JSCustomEventPrototypeTable, this, propertyName, slot); |
|
123 } |
|
124 |
|
125 bool JSCustomEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
126 { |
|
127 return getStaticFunctionDescriptor<JSObject>(exec, &JSCustomEventPrototypeTable, this, propertyName, descriptor); |
|
128 } |
|
129 |
|
130 const ClassInfo JSCustomEvent::s_info = { "CustomEvent", &JSEvent::s_info, &JSCustomEventTable, 0 }; |
|
131 |
|
132 JSCustomEvent::JSCustomEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<CustomEvent> impl) |
|
133 : JSEvent(structure, globalObject, impl) |
|
134 { |
|
135 } |
|
136 |
|
137 JSObject* JSCustomEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
138 { |
|
139 return new (exec) JSCustomEventPrototype(globalObject, JSCustomEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject))); |
|
140 } |
|
141 |
|
142 bool JSCustomEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
143 { |
|
144 return getStaticValueSlot<JSCustomEvent, Base>(exec, &JSCustomEventTable, this, propertyName, slot); |
|
145 } |
|
146 |
|
147 bool JSCustomEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
148 { |
|
149 return getStaticValueDescriptor<JSCustomEvent, Base>(exec, &JSCustomEventTable, this, propertyName, descriptor); |
|
150 } |
|
151 |
|
152 JSValue jsCustomEventDetail(ExecState* exec, JSValue slotBase, const Identifier&) |
|
153 { |
|
154 JSCustomEvent* castedThis = static_cast<JSCustomEvent*>(asObject(slotBase)); |
|
155 UNUSED_PARAM(exec); |
|
156 CustomEvent* imp = static_cast<CustomEvent*>(castedThis->impl()); |
|
157 JSValue result = imp->detail().jsValue();; |
|
158 return result; |
|
159 } |
|
160 |
|
161 JSValue jsCustomEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
162 { |
|
163 JSCustomEvent* domObject = static_cast<JSCustomEvent*>(asObject(slotBase)); |
|
164 return JSCustomEvent::getConstructor(exec, domObject->globalObject()); |
|
165 } |
|
166 JSValue JSCustomEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
167 { |
|
168 return getDOMConstructor<JSCustomEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
169 } |
|
170 |
|
171 EncodedJSValue JSC_HOST_CALL jsCustomEventPrototypeFunctionInitCustomEvent(ExecState* exec) |
|
172 { |
|
173 JSValue thisValue = exec->hostThisValue(); |
|
174 if (!thisValue.inherits(&JSCustomEvent::s_info)) |
|
175 return throwVMTypeError(exec); |
|
176 JSCustomEvent* castedThis = static_cast<JSCustomEvent*>(asObject(thisValue)); |
|
177 CustomEvent* imp = static_cast<CustomEvent*>(castedThis->impl()); |
|
178 const String& typeArg = ustringToString(exec->argument(0).toString(exec)); |
|
179 bool canBubbleArg = exec->argument(1).toBoolean(exec); |
|
180 bool cancelableArg = exec->argument(2).toBoolean(exec); |
|
181 ScriptValue detailArg = exec->argument(3); |
|
182 |
|
183 imp->initCustomEvent(typeArg, canBubbleArg, cancelableArg, detailArg); |
|
184 return JSValue::encode(jsUndefined()); |
|
185 } |
|
186 |
|
187 |
|
188 } |