tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSDOMCoreException.cpp
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 "JSDOMCoreException.h"
23
24 #include "DOMCoreException.h"
25 #include "ExceptionCode.h"
26 #include "JSDOMBinding.h"
27 #include "KURL.h"
28 #include <runtime/Error.h>
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
31
32 using namespace JSC;
33
34 namespace WebCore {
35
36 ASSERT_CLASS_FITS_IN_CELL(JSDOMCoreException);
37
38 /* Hash table */
39 #if ENABLE(JIT)
40 #define THUNK_GENERATOR(generator) , generator
41 #else
42 #define THUNK_GENERATOR(generator)
43 #endif
44 #if ENABLE(DFG_JIT)
45 #define INTRINSIC(intrinsic) , intrinsic
46 #else
47 #define INTRINSIC(intrinsic)
48 #endif
49
50 static const HashTableValue JSDOMCoreExceptionTableValues[] =
51 {
52     { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionName), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
57 };
58
59 #undef THUNK_GENERATOR
60 static const HashTable JSDOMCoreExceptionTable = { 10, 7, JSDOMCoreExceptionTableValues, 0 };
61 /* Hash table for constructor */
62 #if ENABLE(JIT)
63 #define THUNK_GENERATOR(generator) , generator
64 #else
65 #define THUNK_GENERATOR(generator)
66 #endif
67 #if ENABLE(DFG_JIT)
68 #define INTRINSIC(intrinsic) , intrinsic
69 #else
70 #define INTRINSIC(intrinsic)
71 #endif
72
73 static const HashTableValue JSDOMCoreExceptionConstructorTableValues[] =
74 {
75     { "INDEX_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINDEX_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
76     { "DOMSTRING_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionDOMSTRING_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
77     { "HIERARCHY_REQUEST_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionHIERARCHY_REQUEST_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
78     { "WRONG_DOCUMENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionWRONG_DOCUMENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
79     { "INVALID_CHARACTER_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_CHARACTER_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80     { "NO_DATA_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_DATA_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81     { "NO_MODIFICATION_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82     { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83     { "NOT_SUPPORTED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_SUPPORTED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
84     { "INUSE_ATTRIBUTE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
85     { "INVALID_STATE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_STATE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
86     { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
87     { "INVALID_MODIFICATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_MODIFICATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
88     { "NAMESPACE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNAMESPACE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
89     { "INVALID_ACCESS_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_ACCESS_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
90     { "VALIDATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionVALIDATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
91     { "TYPE_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionTYPE_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
92     { "SECURITY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSECURITY_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
93     { "NETWORK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNETWORK_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
94     { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
95     { "URL_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionURL_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
96     { "QUOTA_EXCEEDED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionQUOTA_EXCEEDED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
97     { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
98     { "INVALID_NODE_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_NODE_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
99     { "DATA_CLONE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionDATA_CLONE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
100     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
101 };
102
103 #undef THUNK_GENERATOR
104 static const HashTable JSDOMCoreExceptionConstructorTable = { 68, 63, JSDOMCoreExceptionConstructorTableValues, 0 };
105 const ClassInfo JSDOMCoreExceptionConstructor::s_info = { "DOMExceptionConstructor", &DOMConstructorObject::s_info, &JSDOMCoreExceptionConstructorTable, 0, CREATE_METHOD_TABLE(JSDOMCoreExceptionConstructor) };
106
107 JSDOMCoreExceptionConstructor::JSDOMCoreExceptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
108     : DOMConstructorObject(structure, globalObject)
109 {
110 }
111
112 void JSDOMCoreExceptionConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
113 {
114     Base::finishCreation(exec->globalData());
115     ASSERT(inherits(&s_info));
116     putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMCoreExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly);
117 }
118
119 bool JSDOMCoreExceptionConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
120 {
121     return getStaticValueSlot<JSDOMCoreExceptionConstructor, JSDOMWrapper>(exec, &JSDOMCoreExceptionConstructorTable, static_cast<JSDOMCoreExceptionConstructor*>(cell), propertyName, slot);
122 }
123
124 bool JSDOMCoreExceptionConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
125 {
126     return getStaticValueDescriptor<JSDOMCoreExceptionConstructor, JSDOMWrapper>(exec, &JSDOMCoreExceptionConstructorTable, static_cast<JSDOMCoreExceptionConstructor*>(object), propertyName, descriptor);
127 }
128
129 /* Hash table for prototype */
130 #if ENABLE(JIT)
131 #define THUNK_GENERATOR(generator) , generator
132 #else
133 #define THUNK_GENERATOR(generator)
134 #endif
135 #if ENABLE(DFG_JIT)
136 #define INTRINSIC(intrinsic) , intrinsic
137 #else
138 #define INTRINSIC(intrinsic)
139 #endif
140
141 static const HashTableValue JSDOMCoreExceptionPrototypeTableValues[] =
142 {
143     { "INDEX_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINDEX_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
144     { "DOMSTRING_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionDOMSTRING_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
145     { "HIERARCHY_REQUEST_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionHIERARCHY_REQUEST_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
146     { "WRONG_DOCUMENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionWRONG_DOCUMENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
147     { "INVALID_CHARACTER_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_CHARACTER_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
148     { "NO_DATA_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_DATA_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
149     { "NO_MODIFICATION_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
150     { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
151     { "NOT_SUPPORTED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_SUPPORTED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
152     { "INUSE_ATTRIBUTE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
153     { "INVALID_STATE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_STATE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
154     { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
155     { "INVALID_MODIFICATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_MODIFICATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
156     { "NAMESPACE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNAMESPACE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
157     { "INVALID_ACCESS_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_ACCESS_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
158     { "VALIDATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionVALIDATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
159     { "TYPE_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionTYPE_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
160     { "SECURITY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSECURITY_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
161     { "NETWORK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNETWORK_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
162     { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
163     { "URL_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionURL_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
164     { "QUOTA_EXCEEDED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionQUOTA_EXCEEDED_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
165     { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
166     { "INVALID_NODE_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_NODE_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
167     { "DATA_CLONE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionDATA_CLONE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
168     { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsDOMCoreExceptionPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
169     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
170 };
171
172 #undef THUNK_GENERATOR
173 static const HashTable JSDOMCoreExceptionPrototypeTable = { 69, 63, JSDOMCoreExceptionPrototypeTableValues, 0 };
174 static const HashTable* getJSDOMCoreExceptionPrototypeTable(ExecState* exec)
175 {
176     return getHashTableForGlobalData(exec->globalData(), &JSDOMCoreExceptionPrototypeTable);
177 }
178
179 const ClassInfo JSDOMCoreExceptionPrototype::s_info = { "DOMExceptionPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSDOMCoreExceptionPrototypeTable, CREATE_METHOD_TABLE(JSDOMCoreExceptionPrototype) };
180
181 JSObject* JSDOMCoreExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
182 {
183     return getDOMPrototype<JSDOMCoreException>(exec, globalObject);
184 }
185
186 bool JSDOMCoreExceptionPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
187 {
188     JSDOMCoreExceptionPrototype* thisObject = jsCast<JSDOMCoreExceptionPrototype*>(cell);
189     return getStaticPropertySlot<JSDOMCoreExceptionPrototype, JSObject>(exec, getJSDOMCoreExceptionPrototypeTable(exec), thisObject, propertyName, slot);
190 }
191
192 bool JSDOMCoreExceptionPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
193 {
194     JSDOMCoreExceptionPrototype* thisObject = jsCast<JSDOMCoreExceptionPrototype*>(object);
195     return getStaticPropertyDescriptor<JSDOMCoreExceptionPrototype, JSObject>(exec, getJSDOMCoreExceptionPrototypeTable(exec), thisObject, propertyName, descriptor);
196 }
197
198 static const HashTable* getJSDOMCoreExceptionTable(ExecState* exec)
199 {
200     return getHashTableForGlobalData(exec->globalData(), &JSDOMCoreExceptionTable);
201 }
202
203 const ClassInfo JSDOMCoreException::s_info = { "DOMException", &JSDOMWrapper::s_info, 0, getJSDOMCoreExceptionTable , CREATE_METHOD_TABLE(JSDOMCoreException) };
204
205 JSDOMCoreException::JSDOMCoreException(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMCoreException> impl)
206     : JSDOMWrapper(structure, globalObject)
207     , m_impl(impl.leakRef())
208 {
209 }
210
211 void JSDOMCoreException::finishCreation(JSGlobalData& globalData)
212 {
213     Base::finishCreation(globalData);
214     ASSERT(inherits(&s_info));
215 }
216
217 JSObject* JSDOMCoreException::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
218 {
219     return JSDOMCoreExceptionPrototype::create(exec->globalData(), globalObject, JSDOMCoreExceptionPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
220 }
221
222 bool JSDOMCoreException::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
223 {
224     JSDOMCoreException* thisObject = jsCast<JSDOMCoreException*>(cell);
225     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
226     return getStaticValueSlot<JSDOMCoreException, Base>(exec, getJSDOMCoreExceptionTable(exec), thisObject, propertyName, slot);
227 }
228
229 bool JSDOMCoreException::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
230 {
231     JSDOMCoreException* thisObject = jsCast<JSDOMCoreException*>(object);
232     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
233     return getStaticValueDescriptor<JSDOMCoreException, Base>(exec, getJSDOMCoreExceptionTable(exec), thisObject, propertyName, descriptor);
234 }
235
236 JSValue jsDOMCoreExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&)
237 {
238     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
239     UNUSED_PARAM(exec);
240     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
241     JSValue result = jsNumber(imp->code());
242     return result;
243 }
244
245
246 JSValue jsDOMCoreExceptionName(ExecState* exec, JSValue slotBase, const Identifier&)
247 {
248     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
249     UNUSED_PARAM(exec);
250     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
251     JSValue result = jsString(exec, imp->name());
252     return result;
253 }
254
255
256 JSValue jsDOMCoreExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&)
257 {
258     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
259     UNUSED_PARAM(exec);
260     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
261     JSValue result = jsString(exec, imp->message());
262     return result;
263 }
264
265
266 JSValue jsDOMCoreExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
267 {
268     JSDOMCoreException* domObject = static_cast<JSDOMCoreException*>(asObject(slotBase));
269     return JSDOMCoreException::getConstructor(exec, domObject->globalObject());
270 }
271
272 JSValue JSDOMCoreException::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
273 {
274     return getDOMConstructor<JSDOMCoreExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
275 }
276
277 EncodedJSValue JSC_HOST_CALL jsDOMCoreExceptionPrototypeFunctionToString(ExecState* exec)
278 {
279     JSValue thisValue = exec->hostThisValue();
280     if (!thisValue.inherits(&JSDOMCoreException::s_info))
281         return throwVMTypeError(exec);
282     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(thisValue));
283     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMCoreException::s_info);
284     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
285
286     JSC::JSValue result = jsString(exec, imp->toString());
287     return JSValue::encode(result);
288 }
289
290 // Constant getters
291
292 JSValue jsDOMCoreExceptionINDEX_SIZE_ERR(ExecState* exec, JSValue, const Identifier&)
293 {
294     UNUSED_PARAM(exec);
295     return jsNumber(static_cast<int>(1));
296 }
297
298 JSValue jsDOMCoreExceptionDOMSTRING_SIZE_ERR(ExecState* exec, JSValue, const Identifier&)
299 {
300     UNUSED_PARAM(exec);
301     return jsNumber(static_cast<int>(2));
302 }
303
304 JSValue jsDOMCoreExceptionHIERARCHY_REQUEST_ERR(ExecState* exec, JSValue, const Identifier&)
305 {
306     UNUSED_PARAM(exec);
307     return jsNumber(static_cast<int>(3));
308 }
309
310 JSValue jsDOMCoreExceptionWRONG_DOCUMENT_ERR(ExecState* exec, JSValue, const Identifier&)
311 {
312     UNUSED_PARAM(exec);
313     return jsNumber(static_cast<int>(4));
314 }
315
316 JSValue jsDOMCoreExceptionINVALID_CHARACTER_ERR(ExecState* exec, JSValue, const Identifier&)
317 {
318     UNUSED_PARAM(exec);
319     return jsNumber(static_cast<int>(5));
320 }
321
322 JSValue jsDOMCoreExceptionNO_DATA_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
323 {
324     UNUSED_PARAM(exec);
325     return jsNumber(static_cast<int>(6));
326 }
327
328 JSValue jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
329 {
330     UNUSED_PARAM(exec);
331     return jsNumber(static_cast<int>(7));
332 }
333
334 JSValue jsDOMCoreExceptionNOT_FOUND_ERR(ExecState* exec, JSValue, const Identifier&)
335 {
336     UNUSED_PARAM(exec);
337     return jsNumber(static_cast<int>(8));
338 }
339
340 JSValue jsDOMCoreExceptionNOT_SUPPORTED_ERR(ExecState* exec, JSValue, const Identifier&)
341 {
342     UNUSED_PARAM(exec);
343     return jsNumber(static_cast<int>(9));
344 }
345
346 JSValue jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR(ExecState* exec, JSValue, const Identifier&)
347 {
348     UNUSED_PARAM(exec);
349     return jsNumber(static_cast<int>(10));
350 }
351
352 JSValue jsDOMCoreExceptionINVALID_STATE_ERR(ExecState* exec, JSValue, const Identifier&)
353 {
354     UNUSED_PARAM(exec);
355     return jsNumber(static_cast<int>(11));
356 }
357
358 JSValue jsDOMCoreExceptionSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&)
359 {
360     UNUSED_PARAM(exec);
361     return jsNumber(static_cast<int>(12));
362 }
363
364 JSValue jsDOMCoreExceptionINVALID_MODIFICATION_ERR(ExecState* exec, JSValue, const Identifier&)
365 {
366     UNUSED_PARAM(exec);
367     return jsNumber(static_cast<int>(13));
368 }
369
370 JSValue jsDOMCoreExceptionNAMESPACE_ERR(ExecState* exec, JSValue, const Identifier&)
371 {
372     UNUSED_PARAM(exec);
373     return jsNumber(static_cast<int>(14));
374 }
375
376 JSValue jsDOMCoreExceptionINVALID_ACCESS_ERR(ExecState* exec, JSValue, const Identifier&)
377 {
378     UNUSED_PARAM(exec);
379     return jsNumber(static_cast<int>(15));
380 }
381
382 JSValue jsDOMCoreExceptionVALIDATION_ERR(ExecState* exec, JSValue, const Identifier&)
383 {
384     UNUSED_PARAM(exec);
385     return jsNumber(static_cast<int>(16));
386 }
387
388 JSValue jsDOMCoreExceptionTYPE_MISMATCH_ERR(ExecState* exec, JSValue, const Identifier&)
389 {
390     UNUSED_PARAM(exec);
391     return jsNumber(static_cast<int>(17));
392 }
393
394 JSValue jsDOMCoreExceptionSECURITY_ERR(ExecState* exec, JSValue, const Identifier&)
395 {
396     UNUSED_PARAM(exec);
397     return jsNumber(static_cast<int>(18));
398 }
399
400 JSValue jsDOMCoreExceptionNETWORK_ERR(ExecState* exec, JSValue, const Identifier&)
401 {
402     UNUSED_PARAM(exec);
403     return jsNumber(static_cast<int>(19));
404 }
405
406 JSValue jsDOMCoreExceptionABORT_ERR(ExecState* exec, JSValue, const Identifier&)
407 {
408     UNUSED_PARAM(exec);
409     return jsNumber(static_cast<int>(20));
410 }
411
412 JSValue jsDOMCoreExceptionURL_MISMATCH_ERR(ExecState* exec, JSValue, const Identifier&)
413 {
414     UNUSED_PARAM(exec);
415     return jsNumber(static_cast<int>(21));
416 }
417
418 JSValue jsDOMCoreExceptionQUOTA_EXCEEDED_ERR(ExecState* exec, JSValue, const Identifier&)
419 {
420     UNUSED_PARAM(exec);
421     return jsNumber(static_cast<int>(22));
422 }
423
424 JSValue jsDOMCoreExceptionTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&)
425 {
426     UNUSED_PARAM(exec);
427     return jsNumber(static_cast<int>(23));
428 }
429
430 JSValue jsDOMCoreExceptionINVALID_NODE_TYPE_ERR(ExecState* exec, JSValue, const Identifier&)
431 {
432     UNUSED_PARAM(exec);
433     return jsNumber(static_cast<int>(24));
434 }
435
436 JSValue jsDOMCoreExceptionDATA_CLONE_ERR(ExecState* exec, JSValue, const Identifier&)
437 {
438     UNUSED_PARAM(exec);
439     return jsNumber(static_cast<int>(25));
440 }
441
442 static inline bool isObservable(JSDOMCoreException* jsDOMCoreException)
443 {
444     if (jsDOMCoreException->hasCustomProperties())
445         return true;
446     return false;
447 }
448
449 bool JSDOMCoreExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
450 {
451     JSDOMCoreException* jsDOMCoreException = static_cast<JSDOMCoreException*>(handle.get().asCell());
452     if (!isObservable(jsDOMCoreException))
453         return false;
454     UNUSED_PARAM(visitor);
455     return false;
456 }
457
458 void JSDOMCoreExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
459 {
460     JSDOMCoreException* jsDOMCoreException = static_cast<JSDOMCoreException*>(handle.get().asCell());
461     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
462     uncacheWrapper(world, jsDOMCoreException->impl(), jsDOMCoreException);
463     jsDOMCoreException->releaseImpl();
464 }
465
466 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMCoreException* impl)
467 {
468     return wrap<JSDOMCoreException>(exec, globalObject, impl);
469 }
470
471 DOMCoreException* toDOMCoreException(JSC::JSValue value)
472 {
473     return value.inherits(&JSDOMCoreException::s_info) ? static_cast<JSDOMCoreException*>(asObject(value))->impl() : 0;
474 }
475
476 }