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.
23 #if ENABLE(SQL_DATABASE)
25 #include "JSSQLException.h"
28 #include "SQLException.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSSQLException);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSSQLExceptionTableValues[] =
52 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
58 #undef THUNK_GENERATOR
59 static const HashTable JSSQLExceptionTable = { 9, 7, JSSQLExceptionTableValues, 0 };
60 /* Hash table for constructor */
62 #define THUNK_GENERATOR(generator) , generator
64 #define THUNK_GENERATOR(generator)
67 #define INTRINSIC(intrinsic) , intrinsic
69 #define INTRINSIC(intrinsic)
72 static const HashTableValue JSSQLExceptionConstructorTableValues[] =
74 { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75 { "DATABASE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionDATABASE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
76 { "VERSION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionVERSION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
77 { "TOO_LARGE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTOO_LARGE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
78 { "QUOTA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionQUOTA_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
79 { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80 { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81 { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
85 #undef THUNK_GENERATOR
86 static const HashTable JSSQLExceptionConstructorTable = { 16, 15, JSSQLExceptionConstructorTableValues, 0 };
87 const ClassInfo JSSQLExceptionConstructor::s_info = { "SQLExceptionConstructor", &DOMConstructorObject::s_info, &JSSQLExceptionConstructorTable, 0, CREATE_METHOD_TABLE(JSSQLExceptionConstructor) };
89 JSSQLExceptionConstructor::JSSQLExceptionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
90 : DOMConstructorObject(structure, globalObject)
94 void JSSQLExceptionConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
96 Base::finishCreation(exec->globalData());
97 ASSERT(inherits(&s_info));
98 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSQLExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly);
101 bool JSSQLExceptionConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
103 return getStaticValueSlot<JSSQLExceptionConstructor, JSDOMWrapper>(exec, &JSSQLExceptionConstructorTable, static_cast<JSSQLExceptionConstructor*>(cell), propertyName, slot);
106 bool JSSQLExceptionConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
108 return getStaticValueDescriptor<JSSQLExceptionConstructor, JSDOMWrapper>(exec, &JSSQLExceptionConstructorTable, static_cast<JSSQLExceptionConstructor*>(object), propertyName, descriptor);
111 /* Hash table for prototype */
113 #define THUNK_GENERATOR(generator) , generator
115 #define THUNK_GENERATOR(generator)
118 #define INTRINSIC(intrinsic) , intrinsic
120 #define INTRINSIC(intrinsic)
123 static const HashTableValue JSSQLExceptionPrototypeTableValues[] =
125 { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
126 { "DATABASE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionDATABASE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
127 { "VERSION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionVERSION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
128 { "TOO_LARGE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTOO_LARGE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
129 { "QUOTA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionQUOTA_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
130 { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
131 { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
132 { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
133 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
136 #undef THUNK_GENERATOR
137 static const HashTable JSSQLExceptionPrototypeTable = { 16, 15, JSSQLExceptionPrototypeTableValues, 0 };
138 static const HashTable* getJSSQLExceptionPrototypeTable(ExecState* exec)
140 return getHashTableForGlobalData(exec->globalData(), &JSSQLExceptionPrototypeTable);
143 const ClassInfo JSSQLExceptionPrototype::s_info = { "SQLExceptionPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSSQLExceptionPrototypeTable, CREATE_METHOD_TABLE(JSSQLExceptionPrototype) };
145 JSObject* JSSQLExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
147 return getDOMPrototype<JSSQLException>(exec, globalObject);
150 bool JSSQLExceptionPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
152 JSSQLExceptionPrototype* thisObject = jsCast<JSSQLExceptionPrototype*>(cell);
153 return getStaticValueSlot<JSSQLExceptionPrototype, JSObject>(exec, getJSSQLExceptionPrototypeTable(exec), thisObject, propertyName, slot);
156 bool JSSQLExceptionPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
158 JSSQLExceptionPrototype* thisObject = jsCast<JSSQLExceptionPrototype*>(object);
159 return getStaticValueDescriptor<JSSQLExceptionPrototype, JSObject>(exec, getJSSQLExceptionPrototypeTable(exec), thisObject, propertyName, descriptor);
162 static const HashTable* getJSSQLExceptionTable(ExecState* exec)
164 return getHashTableForGlobalData(exec->globalData(), &JSSQLExceptionTable);
167 const ClassInfo JSSQLException::s_info = { "SQLException", &JSDOMWrapper::s_info, 0, getJSSQLExceptionTable , CREATE_METHOD_TABLE(JSSQLException) };
169 JSSQLException::JSSQLException(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SQLException> impl)
170 : JSDOMWrapper(structure, globalObject)
171 , m_impl(impl.leakRef())
175 void JSSQLException::finishCreation(JSGlobalData& globalData)
177 Base::finishCreation(globalData);
178 ASSERT(inherits(&s_info));
181 JSObject* JSSQLException::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
183 return JSSQLExceptionPrototype::create(exec->globalData(), globalObject, JSSQLExceptionPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
186 bool JSSQLException::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
188 JSSQLException* thisObject = jsCast<JSSQLException*>(cell);
189 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
190 return getStaticValueSlot<JSSQLException, Base>(exec, getJSSQLExceptionTable(exec), thisObject, propertyName, slot);
193 bool JSSQLException::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
195 JSSQLException* thisObject = jsCast<JSSQLException*>(object);
196 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
197 return getStaticValueDescriptor<JSSQLException, Base>(exec, getJSSQLExceptionTable(exec), thisObject, propertyName, descriptor);
200 JSValue jsSQLExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&)
202 JSSQLException* castedThis = static_cast<JSSQLException*>(asObject(slotBase));
204 SQLException* imp = static_cast<SQLException*>(castedThis->impl());
205 JSValue result = jsNumber(imp->code());
210 JSValue jsSQLExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&)
212 JSSQLException* castedThis = static_cast<JSSQLException*>(asObject(slotBase));
214 SQLException* imp = static_cast<SQLException*>(castedThis->impl());
215 JSValue result = jsString(exec, imp->message());
220 JSValue jsSQLExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
222 JSSQLException* domObject = static_cast<JSSQLException*>(asObject(slotBase));
223 return JSSQLException::getConstructor(exec, domObject->globalObject());
226 JSValue JSSQLException::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
228 return getDOMConstructor<JSSQLExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
233 JSValue jsSQLExceptionUNKNOWN_ERR(ExecState* exec, JSValue, const Identifier&)
236 return jsNumber(static_cast<int>(0));
239 JSValue jsSQLExceptionDATABASE_ERR(ExecState* exec, JSValue, const Identifier&)
242 return jsNumber(static_cast<int>(1));
245 JSValue jsSQLExceptionVERSION_ERR(ExecState* exec, JSValue, const Identifier&)
248 return jsNumber(static_cast<int>(2));
251 JSValue jsSQLExceptionTOO_LARGE_ERR(ExecState* exec, JSValue, const Identifier&)
254 return jsNumber(static_cast<int>(3));
257 JSValue jsSQLExceptionQUOTA_ERR(ExecState* exec, JSValue, const Identifier&)
260 return jsNumber(static_cast<int>(4));
263 JSValue jsSQLExceptionSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&)
266 return jsNumber(static_cast<int>(5));
269 JSValue jsSQLExceptionCONSTRAINT_ERR(ExecState* exec, JSValue, const Identifier&)
272 return jsNumber(static_cast<int>(6));
275 JSValue jsSQLExceptionTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&)
278 return jsNumber(static_cast<int>(7));
281 static inline bool isObservable(JSSQLException* jsSQLException)
283 if (jsSQLException->hasCustomProperties())
288 bool JSSQLExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
290 JSSQLException* jsSQLException = static_cast<JSSQLException*>(handle.get().asCell());
291 if (!isObservable(jsSQLException))
293 UNUSED_PARAM(visitor);
297 void JSSQLExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
299 JSSQLException* jsSQLException = static_cast<JSSQLException*>(handle.get().asCell());
300 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
301 uncacheWrapper(world, jsSQLException->impl(), jsSQLException);
302 jsSQLException->releaseImpl();
305 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SQLException* impl)
307 return wrap<JSSQLException>(exec, globalObject, impl);
310 SQLException* toSQLException(JSC::JSValue value)
312 return value.inherits(&JSSQLException::s_info) ? static_cast<JSSQLException*>(asObject(value))->impl() : 0;
317 #endif // ENABLE(SQL_DATABASE)