2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSDOMCoreException.h"
24 #include "DOMCoreException.h"
25 #include "ExceptionCode.h"
26 #include "JSDOMBinding.h"
28 #include <runtime/Error.h>
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSDOMCoreException);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSDOMCoreExceptionTableValues[] =
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) }
59 #undef THUNK_GENERATOR
60 static const HashTable JSDOMCoreExceptionTable = { 10, 7, JSDOMCoreExceptionTableValues, 0 };
61 /* Hash table for constructor */
63 #define THUNK_GENERATOR(generator) , generator
65 #define THUNK_GENERATOR(generator)
68 #define INTRINSIC(intrinsic) , intrinsic
70 #define INTRINSIC(intrinsic)
73 static const HashTableValue JSDOMCoreExceptionConstructorTableValues[] =
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) }
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) };
107 JSDOMCoreExceptionConstructor::JSDOMCoreExceptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
108 : DOMConstructorObject(structure, globalObject)
112 void JSDOMCoreExceptionConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
114 Base::finishCreation(exec->globalData());
115 ASSERT(inherits(&s_info));
116 putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMCoreExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly);
119 bool JSDOMCoreExceptionConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
121 return getStaticValueSlot<JSDOMCoreExceptionConstructor, JSDOMWrapper>(exec, &JSDOMCoreExceptionConstructorTable, static_cast<JSDOMCoreExceptionConstructor*>(cell), propertyName, slot);
124 bool JSDOMCoreExceptionConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
126 return getStaticValueDescriptor<JSDOMCoreExceptionConstructor, JSDOMWrapper>(exec, &JSDOMCoreExceptionConstructorTable, static_cast<JSDOMCoreExceptionConstructor*>(object), propertyName, descriptor);
129 /* Hash table for prototype */
131 #define THUNK_GENERATOR(generator) , generator
133 #define THUNK_GENERATOR(generator)
136 #define INTRINSIC(intrinsic) , intrinsic
138 #define INTRINSIC(intrinsic)
141 static const HashTableValue JSDOMCoreExceptionPrototypeTableValues[] =
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) }
172 #undef THUNK_GENERATOR
173 static const HashTable JSDOMCoreExceptionPrototypeTable = { 69, 63, JSDOMCoreExceptionPrototypeTableValues, 0 };
174 static const HashTable* getJSDOMCoreExceptionPrototypeTable(ExecState* exec)
176 return getHashTableForGlobalData(exec->globalData(), &JSDOMCoreExceptionPrototypeTable);
179 const ClassInfo JSDOMCoreExceptionPrototype::s_info = { "DOMExceptionPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSDOMCoreExceptionPrototypeTable, CREATE_METHOD_TABLE(JSDOMCoreExceptionPrototype) };
181 JSObject* JSDOMCoreExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
183 return getDOMPrototype<JSDOMCoreException>(exec, globalObject);
186 bool JSDOMCoreExceptionPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
188 JSDOMCoreExceptionPrototype* thisObject = jsCast<JSDOMCoreExceptionPrototype*>(cell);
189 return getStaticPropertySlot<JSDOMCoreExceptionPrototype, JSObject>(exec, getJSDOMCoreExceptionPrototypeTable(exec), thisObject, propertyName, slot);
192 bool JSDOMCoreExceptionPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
194 JSDOMCoreExceptionPrototype* thisObject = jsCast<JSDOMCoreExceptionPrototype*>(object);
195 return getStaticPropertyDescriptor<JSDOMCoreExceptionPrototype, JSObject>(exec, getJSDOMCoreExceptionPrototypeTable(exec), thisObject, propertyName, descriptor);
198 static const HashTable* getJSDOMCoreExceptionTable(ExecState* exec)
200 return getHashTableForGlobalData(exec->globalData(), &JSDOMCoreExceptionTable);
203 const ClassInfo JSDOMCoreException::s_info = { "DOMException", &JSDOMWrapper::s_info, 0, getJSDOMCoreExceptionTable , CREATE_METHOD_TABLE(JSDOMCoreException) };
205 JSDOMCoreException::JSDOMCoreException(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMCoreException> impl)
206 : JSDOMWrapper(structure, globalObject)
207 , m_impl(impl.leakRef())
211 void JSDOMCoreException::finishCreation(JSGlobalData& globalData)
213 Base::finishCreation(globalData);
214 ASSERT(inherits(&s_info));
217 JSObject* JSDOMCoreException::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
219 return JSDOMCoreExceptionPrototype::create(exec->globalData(), globalObject, JSDOMCoreExceptionPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
222 bool JSDOMCoreException::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
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);
229 bool JSDOMCoreException::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
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);
236 JSValue jsDOMCoreExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&)
238 JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
240 DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
241 JSValue result = jsNumber(imp->code());
246 JSValue jsDOMCoreExceptionName(ExecState* exec, JSValue slotBase, const Identifier&)
248 JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
250 DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
251 JSValue result = jsString(exec, imp->name());
256 JSValue jsDOMCoreExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&)
258 JSDOMCoreException* castedThis = static_cast<JSDOMCoreException*>(asObject(slotBase));
260 DOMCoreException* imp = static_cast<DOMCoreException*>(castedThis->impl());
261 JSValue result = jsString(exec, imp->message());
266 JSValue jsDOMCoreExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
268 JSDOMCoreException* domObject = static_cast<JSDOMCoreException*>(asObject(slotBase));
269 return JSDOMCoreException::getConstructor(exec, domObject->globalObject());
272 JSValue JSDOMCoreException::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
274 return getDOMConstructor<JSDOMCoreExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
277 EncodedJSValue JSC_HOST_CALL jsDOMCoreExceptionPrototypeFunctionToString(ExecState* exec)
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());
286 JSC::JSValue result = jsString(exec, imp->toString());
287 return JSValue::encode(result);
292 JSValue jsDOMCoreExceptionINDEX_SIZE_ERR(ExecState* exec, JSValue, const Identifier&)
295 return jsNumber(static_cast<int>(1));
298 JSValue jsDOMCoreExceptionDOMSTRING_SIZE_ERR(ExecState* exec, JSValue, const Identifier&)
301 return jsNumber(static_cast<int>(2));
304 JSValue jsDOMCoreExceptionHIERARCHY_REQUEST_ERR(ExecState* exec, JSValue, const Identifier&)
307 return jsNumber(static_cast<int>(3));
310 JSValue jsDOMCoreExceptionWRONG_DOCUMENT_ERR(ExecState* exec, JSValue, const Identifier&)
313 return jsNumber(static_cast<int>(4));
316 JSValue jsDOMCoreExceptionINVALID_CHARACTER_ERR(ExecState* exec, JSValue, const Identifier&)
319 return jsNumber(static_cast<int>(5));
322 JSValue jsDOMCoreExceptionNO_DATA_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
325 return jsNumber(static_cast<int>(6));
328 JSValue jsDOMCoreExceptionNO_MODIFICATION_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&)
331 return jsNumber(static_cast<int>(7));
334 JSValue jsDOMCoreExceptionNOT_FOUND_ERR(ExecState* exec, JSValue, const Identifier&)
337 return jsNumber(static_cast<int>(8));
340 JSValue jsDOMCoreExceptionNOT_SUPPORTED_ERR(ExecState* exec, JSValue, const Identifier&)
343 return jsNumber(static_cast<int>(9));
346 JSValue jsDOMCoreExceptionINUSE_ATTRIBUTE_ERR(ExecState* exec, JSValue, const Identifier&)
349 return jsNumber(static_cast<int>(10));
352 JSValue jsDOMCoreExceptionINVALID_STATE_ERR(ExecState* exec, JSValue, const Identifier&)
355 return jsNumber(static_cast<int>(11));
358 JSValue jsDOMCoreExceptionSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&)
361 return jsNumber(static_cast<int>(12));
364 JSValue jsDOMCoreExceptionINVALID_MODIFICATION_ERR(ExecState* exec, JSValue, const Identifier&)
367 return jsNumber(static_cast<int>(13));
370 JSValue jsDOMCoreExceptionNAMESPACE_ERR(ExecState* exec, JSValue, const Identifier&)
373 return jsNumber(static_cast<int>(14));
376 JSValue jsDOMCoreExceptionINVALID_ACCESS_ERR(ExecState* exec, JSValue, const Identifier&)
379 return jsNumber(static_cast<int>(15));
382 JSValue jsDOMCoreExceptionVALIDATION_ERR(ExecState* exec, JSValue, const Identifier&)
385 return jsNumber(static_cast<int>(16));
388 JSValue jsDOMCoreExceptionTYPE_MISMATCH_ERR(ExecState* exec, JSValue, const Identifier&)
391 return jsNumber(static_cast<int>(17));
394 JSValue jsDOMCoreExceptionSECURITY_ERR(ExecState* exec, JSValue, const Identifier&)
397 return jsNumber(static_cast<int>(18));
400 JSValue jsDOMCoreExceptionNETWORK_ERR(ExecState* exec, JSValue, const Identifier&)
403 return jsNumber(static_cast<int>(19));
406 JSValue jsDOMCoreExceptionABORT_ERR(ExecState* exec, JSValue, const Identifier&)
409 return jsNumber(static_cast<int>(20));
412 JSValue jsDOMCoreExceptionURL_MISMATCH_ERR(ExecState* exec, JSValue, const Identifier&)
415 return jsNumber(static_cast<int>(21));
418 JSValue jsDOMCoreExceptionQUOTA_EXCEEDED_ERR(ExecState* exec, JSValue, const Identifier&)
421 return jsNumber(static_cast<int>(22));
424 JSValue jsDOMCoreExceptionTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&)
427 return jsNumber(static_cast<int>(23));
430 JSValue jsDOMCoreExceptionINVALID_NODE_TYPE_ERR(ExecState* exec, JSValue, const Identifier&)
433 return jsNumber(static_cast<int>(24));
436 JSValue jsDOMCoreExceptionDATA_CLONE_ERR(ExecState* exec, JSValue, const Identifier&)
439 return jsNumber(static_cast<int>(25));
442 static inline bool isObservable(JSDOMCoreException* jsDOMCoreException)
444 if (jsDOMCoreException->hasCustomProperties())
449 bool JSDOMCoreExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
451 JSDOMCoreException* jsDOMCoreException = static_cast<JSDOMCoreException*>(handle.get().asCell());
452 if (!isObservable(jsDOMCoreException))
454 UNUSED_PARAM(visitor);
458 void JSDOMCoreExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
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();
466 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMCoreException* impl)
468 return wrap<JSDOMCoreException>(exec, globalObject, impl);
471 DOMCoreException* toDOMCoreException(JSC::JSValue value)
473 return value.inherits(&JSDOMCoreException::s_info) ? static_cast<JSDOMCoreException*>(asObject(value))->impl() : 0;