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 
45 static const HashTableValue JSDOMCoreExceptionTableValues[5] =
46 {
47     { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) },
48     { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionName), (intptr_t)0 THUNK_GENERATOR(0) },
49     { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) },
50     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
51     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
52 };
53 
54 #undef THUNK_GENERATOR
55 static JSC_CONST_HASHTABLE HashTable JSDOMCoreExceptionTable = { 10, 7, JSDOMCoreExceptionTableValues, 0 };
56 /* Hash table for constructor */
57 #if ENABLE(JIT)
58 #define THUNK_GENERATOR(generator) , generator
59 #else
60 #define THUNK_GENERATOR(generator)
61 #endif
62 
63 static const HashTableValue JSDOMCoreExceptionConstructorTableValues[23] =
64 {
65     { "INDEX_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINDEX_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
66     { "DOMSTRING_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionDOMSTRING_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
67     { "HIERARCHY_REQUEST_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionHIERARCHY_REQUEST_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
68     { "WRONG_DOCUMENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionWRONG_DOCUMENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
69     { "INVALID_CHARACTER_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_CHARACTER_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
70     { "NO_DATA_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_DATA_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
71     { "NO_MODIFICATION_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
72     { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
73     { "NOT_SUPPORTED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_SUPPORTED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
74     { "INUSE_ATTRIBUTE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
75     { "INVALID_STATE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_STATE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
76     { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
77     { "INVALID_MODIFICATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_MODIFICATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
78     { "NAMESPACE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNAMESPACE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
79     { "INVALID_ACCESS_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_ACCESS_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
80     { "VALIDATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionVALIDATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
81     { "TYPE_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionTYPE_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
82     { "SECURITY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSECURITY_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
83     { "NETWORK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNETWORK_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
84     { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
85     { "URL_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionURL_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
86     { "QUOTA_EXCEEDED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionQUOTA_EXCEEDED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
87     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
88 };
89 
90 #undef THUNK_GENERATOR
91 static JSC_CONST_HASHTABLE HashTable JSDOMCoreExceptionConstructorTable = { 67, 63, JSDOMCoreExceptionConstructorTableValues, 0 };
92 class JSDOMCoreExceptionConstructor : public DOMConstructorObject {
93 public:
94     JSDOMCoreExceptionConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
95 
96     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
97     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
98     static const JSC::ClassInfo s_info;
createStructure(JSC::JSGlobalData & globalData,JSC::JSValue prototype)99     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
100     {
101         return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
102     }
103 protected:
104     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
105 };
106 
107 const ClassInfo JSDOMCoreExceptionConstructor::s_info = { "DOMExceptionConstructor", &DOMConstructorObject::s_info, &JSDOMCoreExceptionConstructorTable, 0 };
108 
JSDOMCoreExceptionConstructor(ExecState * exec,Structure * structure,JSDOMGlobalObject * globalObject)109 JSDOMCoreExceptionConstructor::JSDOMCoreExceptionConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
110     : DOMConstructorObject(structure, globalObject)
111 {
112     ASSERT(inherits(&s_info));
113     putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMCoreExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly);
114 }
115 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)116 bool JSDOMCoreExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
117 {
118     return getStaticValueSlot<JSDOMCoreExceptionConstructor, JSDOMWrapper>(exec, &JSDOMCoreExceptionConstructorTable, this, propertyName, slot);
119 }
120 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)121 bool JSDOMCoreExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
122 {
123     return getStaticValueDescriptor<JSDOMCoreExceptionConstructor, JSDOMWrapper>(exec, &JSDOMCoreExceptionConstructorTable, this, propertyName, descriptor);
124 }
125 
126 /* Hash table for prototype */
127 #if ENABLE(JIT)
128 #define THUNK_GENERATOR(generator) , generator
129 #else
130 #define THUNK_GENERATOR(generator)
131 #endif
132 
133 static const HashTableValue JSDOMCoreExceptionPrototypeTableValues[24] =
134 {
135     { "INDEX_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINDEX_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
136     { "DOMSTRING_SIZE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionDOMSTRING_SIZE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
137     { "HIERARCHY_REQUEST_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionHIERARCHY_REQUEST_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
138     { "WRONG_DOCUMENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionWRONG_DOCUMENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
139     { "INVALID_CHARACTER_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_CHARACTER_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
140     { "NO_DATA_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_DATA_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
141     { "NO_MODIFICATION_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
142     { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
143     { "NOT_SUPPORTED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNOT_SUPPORTED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
144     { "INUSE_ATTRIBUTE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
145     { "INVALID_STATE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_STATE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
146     { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
147     { "INVALID_MODIFICATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_MODIFICATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
148     { "NAMESPACE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNAMESPACE_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
149     { "INVALID_ACCESS_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionINVALID_ACCESS_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
150     { "VALIDATION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionVALIDATION_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
151     { "TYPE_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionTYPE_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
152     { "SECURITY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionSECURITY_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
153     { "NETWORK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionNETWORK_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
154     { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
155     { "URL_MISMATCH_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionURL_MISMATCH_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
156     { "QUOTA_EXCEEDED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMCoreExceptionQUOTA_EXCEEDED_ERR), (intptr_t)0 THUNK_GENERATOR(0) },
157     { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsDOMCoreExceptionPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) },
158     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
159 };
160 
161 #undef THUNK_GENERATOR
162 static JSC_CONST_HASHTABLE HashTable JSDOMCoreExceptionPrototypeTable = { 68, 63, JSDOMCoreExceptionPrototypeTableValues, 0 };
getJSDOMCoreExceptionPrototypeTable(ExecState * exec)163 static const HashTable* getJSDOMCoreExceptionPrototypeTable(ExecState* exec)
164 {
165     return getHashTableForGlobalData(exec->globalData(), &JSDOMCoreExceptionPrototypeTable);
166 }
167 
168 const ClassInfo JSDOMCoreExceptionPrototype::s_info = { "DOMExceptionPrototype", &JSC::JSObjectWithGlobalObject::s_info, 0, getJSDOMCoreExceptionPrototypeTable };
169 
self(ExecState * exec,JSGlobalObject * globalObject)170 JSObject* JSDOMCoreExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
171 {
172     return getDOMPrototype<JSDOMCoreException>(exec, globalObject);
173 }
174 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)175 bool JSDOMCoreExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
176 {
177     return getStaticPropertySlot<JSDOMCoreExceptionPrototype, JSObject>(exec, getJSDOMCoreExceptionPrototypeTable(exec), this, propertyName, slot);
178 }
179 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)180 bool JSDOMCoreExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
181 {
182     return getStaticPropertyDescriptor<JSDOMCoreExceptionPrototype, JSObject>(exec, getJSDOMCoreExceptionPrototypeTable(exec), this, propertyName, descriptor);
183 }
184 
getJSDOMCoreExceptionTable(ExecState * exec)185 static const HashTable* getJSDOMCoreExceptionTable(ExecState* exec)
186 {
187     return getHashTableForGlobalData(exec->globalData(), &JSDOMCoreExceptionTable);
188 }
189 
190 const ClassInfo JSDOMCoreException::s_info = { "DOMException", &JSDOMWrapper::s_info, 0, getJSDOMCoreExceptionTable };
191 
JSDOMCoreException(Structure * structure,JSDOMGlobalObject * globalObject,PassRefPtr<DOMCoreException> impl)192 JSDOMCoreException::JSDOMCoreException(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMCoreException> impl)
193     : JSDOMWrapper(structure, globalObject)
194     , m_impl(impl)
195 {
196     ASSERT(inherits(&s_info));
197 }
198 
createPrototype(ExecState * exec,JSGlobalObject * globalObject)199 JSObject* JSDOMCoreException::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
200 {
201     return new (exec) JSDOMCoreExceptionPrototype(exec->globalData(), globalObject, JSDOMCoreExceptionPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
202 }
203 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)204 bool JSDOMCoreException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
205 {
206     return getStaticValueSlot<JSDOMCoreException, Base>(exec, getJSDOMCoreExceptionTable(exec), this, propertyName, slot);
207 }
208 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)209 bool JSDOMCoreException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
210 {
211     return getStaticValueDescriptor<JSDOMCoreException, Base>(exec, getJSDOMCoreExceptionTable(exec), this, propertyName, descriptor);
212 }
213 
jsDOMCoreExceptionCode(ExecState * exec,JSValue slotBase,const Identifier &)214 JSValue jsDOMCoreExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&)
215 {
216     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
217     UNUSED_PARAM(exec);
218     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
219     JSValue result = jsNumber(imp->code());
220     return result;
221 }
222 
223 
jsDOMCoreExceptionName(ExecState * exec,JSValue slotBase,const Identifier &)224 JSValue jsDOMCoreExceptionName(ExecState* exec, JSValue slotBase, const Identifier&)
225 {
226     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
227     UNUSED_PARAM(exec);
228     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
229     JSValue result = jsString(exec, imp->name());
230     return result;
231 }
232 
233 
jsDOMCoreExceptionMessage(ExecState * exec,JSValue slotBase,const Identifier &)234 JSValue jsDOMCoreExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&)
235 {
236     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
237     UNUSED_PARAM(exec);
238     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
239     JSValue result = jsString(exec, imp->message());
240     return result;
241 }
242 
243 
jsDOMCoreExceptionConstructor(ExecState * exec,JSValue slotBase,const Identifier &)244 JSValue jsDOMCoreExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
245 {
246     JSDOMCoreException* domObject = static_cast<JSDOMCoreException*>(asObject(slotBase));
247     return JSDOMCoreException::getConstructor(exec, domObject->globalObject());
248 }
249 
getConstructor(ExecState * exec,JSGlobalObject * globalObject)250 JSValue JSDOMCoreException::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
251 {
252     return getDOMConstructor<JSDOMCoreExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
253 }
254 
jsDOMCoreExceptionPrototypeFunctionToString(ExecState * exec)255 EncodedJSValue JSC_HOST_CALL jsDOMCoreExceptionPrototypeFunctionToString(ExecState* exec)
256 {
257     JSValue thisValue = exec->hostThisValue();
258     if (!thisValue.inherits(&JSDOMCoreException::s_info))
259         return throwVMTypeError(exec);
260     JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(thisValue));
261     DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
262 
263 
264     JSC::JSValue result = jsString(exec, imp->toString());
265     return JSValue::encode(result);
266 }
267 
268 // Constant getters
269 
jsDOMCoreExceptionINDEX_SIZE_ERR(ExecState * exec,JSValue,const Identifier &)270 JSValue jsDOMCoreExceptionINDEX_SIZE_ERR(ExecState* exec, JSValue, const Identifier&)
271 {
272     UNUSED_PARAM(exec);
273     return jsNumber(static_cast<int>(1));
274 }
275 
jsDOMCoreExceptionDOMSTRING_SIZE_ERR(ExecState * exec,JSValue,const Identifier &)276 JSValue jsDOMCoreExceptionDOMSTRING_SIZE_ERR(ExecState* exec, JSValue, const Identifier&)
277 {
278     UNUSED_PARAM(exec);
279     return jsNumber(static_cast<int>(2));
280 }
281 
jsDOMCoreExceptionHIERARCHY_REQUEST_ERR(ExecState * exec,JSValue,const Identifier &)282 JSValue jsDOMCoreExceptionHIERARCHY_REQUEST_ERR(ExecState* exec, JSValue, const Identifier&)
283 {
284     UNUSED_PARAM(exec);
285     return jsNumber(static_cast<int>(3));
286 }
287 
jsDOMCoreExceptionWRONG_DOCUMENT_ERR(ExecState * exec,JSValue,const Identifier &)288 JSValue jsDOMCoreExceptionWRONG_DOCUMENT_ERR(ExecState* exec, JSValue, const Identifier&)
289 {
290     UNUSED_PARAM(exec);
291     return jsNumber(static_cast<int>(4));
292 }
293 
jsDOMCoreExceptionINVALID_CHARACTER_ERR(ExecState * exec,JSValue,const Identifier &)294 JSValue jsDOMCoreExceptionINVALID_CHARACTER_ERR(ExecState* exec, JSValue, const Identifier&)
295 {
296     UNUSED_PARAM(exec);
297     return jsNumber(static_cast<int>(5));
298 }
299 
jsDOMCoreExceptionNO_DATA_ALLOWED_ERR(ExecState * exec,JSValue,const Identifier &)300 JSValue jsDOMCoreExceptionNO_DATA_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
301 {
302     UNUSED_PARAM(exec);
303     return jsNumber(static_cast<int>(6));
304 }
305 
jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR(ExecState * exec,JSValue,const Identifier &)306 JSValue jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
307 {
308     UNUSED_PARAM(exec);
309     return jsNumber(static_cast<int>(7));
310 }
311 
jsDOMCoreExceptionNOT_FOUND_ERR(ExecState * exec,JSValue,const Identifier &)312 JSValue jsDOMCoreExceptionNOT_FOUND_ERR(ExecState* exec, JSValue, const Identifier&)
313 {
314     UNUSED_PARAM(exec);
315     return jsNumber(static_cast<int>(8));
316 }
317 
jsDOMCoreExceptionNOT_SUPPORTED_ERR(ExecState * exec,JSValue,const Identifier &)318 JSValue jsDOMCoreExceptionNOT_SUPPORTED_ERR(ExecState* exec, JSValue, const Identifier&)
319 {
320     UNUSED_PARAM(exec);
321     return jsNumber(static_cast<int>(9));
322 }
323 
jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR(ExecState * exec,JSValue,const Identifier &)324 JSValue jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR(ExecState* exec, JSValue, const Identifier&)
325 {
326     UNUSED_PARAM(exec);
327     return jsNumber(static_cast<int>(10));
328 }
329 
jsDOMCoreExceptionINVALID_STATE_ERR(ExecState * exec,JSValue,const Identifier &)330 JSValue jsDOMCoreExceptionINVALID_STATE_ERR(ExecState* exec, JSValue, const Identifier&)
331 {
332     UNUSED_PARAM(exec);
333     return jsNumber(static_cast<int>(11));
334 }
335 
jsDOMCoreExceptionSYNTAX_ERR(ExecState * exec,JSValue,const Identifier &)336 JSValue jsDOMCoreExceptionSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&)
337 {
338     UNUSED_PARAM(exec);
339     return jsNumber(static_cast<int>(12));
340 }
341 
jsDOMCoreExceptionINVALID_MODIFICATION_ERR(ExecState * exec,JSValue,const Identifier &)342 JSValue jsDOMCoreExceptionINVALID_MODIFICATION_ERR(ExecState* exec, JSValue, const Identifier&)
343 {
344     UNUSED_PARAM(exec);
345     return jsNumber(static_cast<int>(13));
346 }
347 
jsDOMCoreExceptionNAMESPACE_ERR(ExecState * exec,JSValue,const Identifier &)348 JSValue jsDOMCoreExceptionNAMESPACE_ERR(ExecState* exec, JSValue, const Identifier&)
349 {
350     UNUSED_PARAM(exec);
351     return jsNumber(static_cast<int>(14));
352 }
353 
jsDOMCoreExceptionINVALID_ACCESS_ERR(ExecState * exec,JSValue,const Identifier &)354 JSValue jsDOMCoreExceptionINVALID_ACCESS_ERR(ExecState* exec, JSValue, const Identifier&)
355 {
356     UNUSED_PARAM(exec);
357     return jsNumber(static_cast<int>(15));
358 }
359 
jsDOMCoreExceptionVALIDATION_ERR(ExecState * exec,JSValue,const Identifier &)360 JSValue jsDOMCoreExceptionVALIDATION_ERR(ExecState* exec, JSValue, const Identifier&)
361 {
362     UNUSED_PARAM(exec);
363     return jsNumber(static_cast<int>(16));
364 }
365 
jsDOMCoreExceptionTYPE_MISMATCH_ERR(ExecState * exec,JSValue,const Identifier &)366 JSValue jsDOMCoreExceptionTYPE_MISMATCH_ERR(ExecState* exec, JSValue, const Identifier&)
367 {
368     UNUSED_PARAM(exec);
369     return jsNumber(static_cast<int>(17));
370 }
371 
jsDOMCoreExceptionSECURITY_ERR(ExecState * exec,JSValue,const Identifier &)372 JSValue jsDOMCoreExceptionSECURITY_ERR(ExecState* exec, JSValue, const Identifier&)
373 {
374     UNUSED_PARAM(exec);
375     return jsNumber(static_cast<int>(18));
376 }
377 
jsDOMCoreExceptionNETWORK_ERR(ExecState * exec,JSValue,const Identifier &)378 JSValue jsDOMCoreExceptionNETWORK_ERR(ExecState* exec, JSValue, const Identifier&)
379 {
380     UNUSED_PARAM(exec);
381     return jsNumber(static_cast<int>(19));
382 }
383 
jsDOMCoreExceptionABORT_ERR(ExecState * exec,JSValue,const Identifier &)384 JSValue jsDOMCoreExceptionABORT_ERR(ExecState* exec, JSValue, const Identifier&)
385 {
386     UNUSED_PARAM(exec);
387     return jsNumber(static_cast<int>(20));
388 }
389 
jsDOMCoreExceptionURL_MISMATCH_ERR(ExecState * exec,JSValue,const Identifier &)390 JSValue jsDOMCoreExceptionURL_MISMATCH_ERR(ExecState* exec, JSValue, const Identifier&)
391 {
392     UNUSED_PARAM(exec);
393     return jsNumber(static_cast<int>(21));
394 }
395 
jsDOMCoreExceptionQUOTA_EXCEEDED_ERR(ExecState * exec,JSValue,const Identifier &)396 JSValue jsDOMCoreExceptionQUOTA_EXCEEDED_ERR(ExecState* exec, JSValue, const Identifier&)
397 {
398     UNUSED_PARAM(exec);
399     return jsNumber(static_cast<int>(22));
400 }
401 
toJS(JSC::ExecState * exec,JSDOMGlobalObject * globalObject,DOMCoreException * impl)402 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMCoreException* impl)
403 {
404     return wrap<JSDOMCoreException>(exec, globalObject, impl);
405 }
406 
toDOMCoreException(JSC::JSValue value)407 DOMCoreException* toDOMCoreException(JSC::JSValue value)
408 {
409     return value.inherits(&JSDOMCoreException::s_info) ? static_cast<JSDOMCoreException*>(asObject(value))->impl() : 0;
410 }
411 
412 }
413