|
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 "JSEventException.h" |
|
23 |
|
24 #include "EventException.h" |
|
25 #include "KURL.h" |
|
26 #include <runtime/Error.h> |
|
27 #include <runtime/JSNumberCell.h> |
|
28 #include <runtime/JSString.h> |
|
29 #include <wtf/GetPtr.h> |
|
30 |
|
31 using namespace JSC; |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 ASSERT_CLASS_FITS_IN_CELL(JSEventException); |
|
36 |
|
37 /* Hash table */ |
|
38 #if ENABLE(JIT) |
|
39 #define THUNK_GENERATOR(generator) , generator |
|
40 #else |
|
41 #define THUNK_GENERATOR(generator) |
|
42 #endif |
|
43 |
|
44 static const HashTableValue JSEventExceptionTableValues[5] = |
|
45 { |
|
46 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEventExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
47 { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEventExceptionName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEventExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEventExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
51 }; |
|
52 |
|
53 #undef THUNK_GENERATOR |
|
54 static JSC_CONST_HASHTABLE HashTable JSEventExceptionTable = { 10, 7, JSEventExceptionTableValues, 0 }; |
|
55 /* Hash table for constructor */ |
|
56 #if ENABLE(JIT) |
|
57 #define THUNK_GENERATOR(generator) , generator |
|
58 #else |
|
59 #define THUNK_GENERATOR(generator) |
|
60 #endif |
|
61 |
|
62 static const HashTableValue JSEventExceptionConstructorTableValues[2] = |
|
63 { |
|
64 { "UNSPECIFIED_EVENT_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEventExceptionUNSPECIFIED_EVENT_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
66 }; |
|
67 |
|
68 #undef THUNK_GENERATOR |
|
69 static JSC_CONST_HASHTABLE HashTable JSEventExceptionConstructorTable = { 2, 1, JSEventExceptionConstructorTableValues, 0 }; |
|
70 class JSEventExceptionConstructor : public DOMConstructorObject { |
|
71 public: |
|
72 JSEventExceptionConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
73 |
|
74 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
75 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
76 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
77 static const JSC::ClassInfo s_info; |
|
78 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
79 { |
|
80 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
81 } |
|
82 protected: |
|
83 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
84 }; |
|
85 |
|
86 const ClassInfo JSEventExceptionConstructor::s_info = { "EventExceptionConstructor", 0, &JSEventExceptionConstructorTable, 0 }; |
|
87 |
|
88 JSEventExceptionConstructor::JSEventExceptionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
89 : DOMConstructorObject(JSEventExceptionConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
90 { |
|
91 putDirect(exec->propertyNames().prototype, JSEventExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
92 } |
|
93 |
|
94 bool JSEventExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
95 { |
|
96 return getStaticValueSlot<JSEventExceptionConstructor, DOMObject>(exec, &JSEventExceptionConstructorTable, this, propertyName, slot); |
|
97 } |
|
98 |
|
99 bool JSEventExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
100 { |
|
101 return getStaticValueDescriptor<JSEventExceptionConstructor, DOMObject>(exec, &JSEventExceptionConstructorTable, this, propertyName, descriptor); |
|
102 } |
|
103 |
|
104 /* Hash table for prototype */ |
|
105 #if ENABLE(JIT) |
|
106 #define THUNK_GENERATOR(generator) , generator |
|
107 #else |
|
108 #define THUNK_GENERATOR(generator) |
|
109 #endif |
|
110 |
|
111 static const HashTableValue JSEventExceptionPrototypeTableValues[3] = |
|
112 { |
|
113 { "UNSPECIFIED_EVENT_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsEventExceptionUNSPECIFIED_EVENT_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
114 { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsEventExceptionPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
115 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
116 }; |
|
117 |
|
118 #undef THUNK_GENERATOR |
|
119 static JSC_CONST_HASHTABLE HashTable JSEventExceptionPrototypeTable = { 5, 3, JSEventExceptionPrototypeTableValues, 0 }; |
|
120 static const HashTable* getJSEventExceptionPrototypeTable(ExecState* exec) |
|
121 { |
|
122 return getHashTableForGlobalData(exec->globalData(), &JSEventExceptionPrototypeTable); |
|
123 } |
|
124 const ClassInfo JSEventExceptionPrototype::s_info = { "EventExceptionPrototype", 0, 0, getJSEventExceptionPrototypeTable }; |
|
125 |
|
126 JSObject* JSEventExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
127 { |
|
128 return getDOMPrototype<JSEventException>(exec, globalObject); |
|
129 } |
|
130 |
|
131 bool JSEventExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
132 { |
|
133 return getStaticPropertySlot<JSEventExceptionPrototype, JSObject>(exec, getJSEventExceptionPrototypeTable(exec), this, propertyName, slot); |
|
134 } |
|
135 |
|
136 bool JSEventExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
137 { |
|
138 return getStaticPropertyDescriptor<JSEventExceptionPrototype, JSObject>(exec, getJSEventExceptionPrototypeTable(exec), this, propertyName, descriptor); |
|
139 } |
|
140 |
|
141 static const HashTable* getJSEventExceptionTable(ExecState* exec) |
|
142 { |
|
143 return getHashTableForGlobalData(exec->globalData(), &JSEventExceptionTable); |
|
144 } |
|
145 const ClassInfo JSEventException::s_info = { "EventException", 0, 0, getJSEventExceptionTable }; |
|
146 |
|
147 JSEventException::JSEventException(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<EventException> impl) |
|
148 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
149 , m_impl(impl) |
|
150 { |
|
151 } |
|
152 |
|
153 JSEventException::~JSEventException() |
|
154 { |
|
155 forgetDOMObject(this, impl()); |
|
156 } |
|
157 |
|
158 JSObject* JSEventException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
159 { |
|
160 return new (exec) JSEventExceptionPrototype(globalObject, JSEventExceptionPrototype::createStructure(globalObject->objectPrototype())); |
|
161 } |
|
162 |
|
163 bool JSEventException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
164 { |
|
165 return getStaticValueSlot<JSEventException, Base>(exec, getJSEventExceptionTable(exec), this, propertyName, slot); |
|
166 } |
|
167 |
|
168 bool JSEventException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
169 { |
|
170 return getStaticValueDescriptor<JSEventException, Base>(exec, getJSEventExceptionTable(exec), this, propertyName, descriptor); |
|
171 } |
|
172 |
|
173 JSValue jsEventExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&) |
|
174 { |
|
175 JSEventException* castedThis = static_cast<JSEventException*>(asObject(slotBase)); |
|
176 UNUSED_PARAM(exec); |
|
177 EventException* imp = static_cast<EventException*>(castedThis->impl()); |
|
178 JSValue result = jsNumber(exec, imp->code()); |
|
179 return result; |
|
180 } |
|
181 |
|
182 JSValue jsEventExceptionName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
183 { |
|
184 JSEventException* castedThis = static_cast<JSEventException*>(asObject(slotBase)); |
|
185 UNUSED_PARAM(exec); |
|
186 EventException* imp = static_cast<EventException*>(castedThis->impl()); |
|
187 JSValue result = jsString(exec, imp->name()); |
|
188 return result; |
|
189 } |
|
190 |
|
191 JSValue jsEventExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
192 { |
|
193 JSEventException* castedThis = static_cast<JSEventException*>(asObject(slotBase)); |
|
194 UNUSED_PARAM(exec); |
|
195 EventException* imp = static_cast<EventException*>(castedThis->impl()); |
|
196 JSValue result = jsString(exec, imp->message()); |
|
197 return result; |
|
198 } |
|
199 |
|
200 JSValue jsEventExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
201 { |
|
202 JSEventException* domObject = static_cast<JSEventException*>(asObject(slotBase)); |
|
203 return JSEventException::getConstructor(exec, domObject->globalObject()); |
|
204 } |
|
205 JSValue JSEventException::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
206 { |
|
207 return getDOMConstructor<JSEventExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
208 } |
|
209 |
|
210 EncodedJSValue JSC_HOST_CALL jsEventExceptionPrototypeFunctionToString(ExecState* exec) |
|
211 { |
|
212 JSValue thisValue = exec->hostThisValue(); |
|
213 if (!thisValue.inherits(&JSEventException::s_info)) |
|
214 return throwVMTypeError(exec); |
|
215 JSEventException* castedThis = static_cast<JSEventException*>(asObject(thisValue)); |
|
216 EventException* imp = static_cast<EventException*>(castedThis->impl()); |
|
217 |
|
218 |
|
219 JSC::JSValue result = jsString(exec, imp->toString()); |
|
220 return JSValue::encode(result); |
|
221 } |
|
222 |
|
223 // Constant getters |
|
224 |
|
225 JSValue jsEventExceptionUNSPECIFIED_EVENT_TYPE_ERR(ExecState* exec, JSValue, const Identifier&) |
|
226 { |
|
227 return jsNumber(exec, static_cast<int>(0)); |
|
228 } |
|
229 |
|
230 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, EventException* object) |
|
231 { |
|
232 return getDOMObjectWrapper<JSEventException>(exec, globalObject, object); |
|
233 } |
|
234 EventException* toEventException(JSC::JSValue value) |
|
235 { |
|
236 return value.inherits(&JSEventException::s_info) ? static_cast<JSEventException*>(asObject(value))->impl() : 0; |
|
237 } |
|
238 |
|
239 } |