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 "JSSQLError.h"
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSSQLError);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSSQLErrorTableValues[] =
52 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorCode), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorMessage), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
57 #undef THUNK_GENERATOR
58 static const HashTable JSSQLErrorTable = { 4, 3, JSSQLErrorTableValues, 0 };
59 /* Hash table for prototype */
61 #define THUNK_GENERATOR(generator) , generator
63 #define THUNK_GENERATOR(generator)
66 #define INTRINSIC(intrinsic) , intrinsic
68 #define INTRINSIC(intrinsic)
71 static const HashTableValue JSSQLErrorPrototypeTableValues[] =
73 { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
74 { "DATABASE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorDATABASE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
75 { "VERSION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorVERSION_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
76 { "TOO_LARGE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorTOO_LARGE_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
77 { "QUOTA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorQUOTA_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
78 { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
79 { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80 { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
84 #undef THUNK_GENERATOR
85 static const HashTable JSSQLErrorPrototypeTable = { 16, 15, JSSQLErrorPrototypeTableValues, 0 };
86 static const HashTable* getJSSQLErrorPrototypeTable(ExecState* exec)
88 return getHashTableForGlobalData(exec->globalData(), &JSSQLErrorPrototypeTable);
91 const ClassInfo JSSQLErrorPrototype::s_info = { "SQLErrorPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSSQLErrorPrototypeTable, CREATE_METHOD_TABLE(JSSQLErrorPrototype) };
93 JSObject* JSSQLErrorPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
95 return getDOMPrototype<JSSQLError>(exec, globalObject);
98 bool JSSQLErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
100 JSSQLErrorPrototype* thisObject = jsCast<JSSQLErrorPrototype*>(cell);
101 return getStaticValueSlot<JSSQLErrorPrototype, JSObject>(exec, getJSSQLErrorPrototypeTable(exec), thisObject, propertyName, slot);
104 bool JSSQLErrorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
106 JSSQLErrorPrototype* thisObject = jsCast<JSSQLErrorPrototype*>(object);
107 return getStaticValueDescriptor<JSSQLErrorPrototype, JSObject>(exec, getJSSQLErrorPrototypeTable(exec), thisObject, propertyName, descriptor);
110 static const HashTable* getJSSQLErrorTable(ExecState* exec)
112 return getHashTableForGlobalData(exec->globalData(), &JSSQLErrorTable);
115 const ClassInfo JSSQLError::s_info = { "SQLError", &JSDOMWrapper::s_info, 0, getJSSQLErrorTable , CREATE_METHOD_TABLE(JSSQLError) };
117 JSSQLError::JSSQLError(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SQLError> impl)
118 : JSDOMWrapper(structure, globalObject)
119 , m_impl(impl.leakRef())
123 void JSSQLError::finishCreation(JSGlobalData& globalData)
125 Base::finishCreation(globalData);
126 ASSERT(inherits(&s_info));
129 JSObject* JSSQLError::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
131 return JSSQLErrorPrototype::create(exec->globalData(), globalObject, JSSQLErrorPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
134 bool JSSQLError::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
136 JSSQLError* thisObject = jsCast<JSSQLError*>(cell);
137 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
138 return getStaticValueSlot<JSSQLError, Base>(exec, getJSSQLErrorTable(exec), thisObject, propertyName, slot);
141 bool JSSQLError::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
143 JSSQLError* thisObject = jsCast<JSSQLError*>(object);
144 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
145 return getStaticValueDescriptor<JSSQLError, Base>(exec, getJSSQLErrorTable(exec), thisObject, propertyName, descriptor);
148 JSValue jsSQLErrorCode(ExecState* exec, JSValue slotBase, const Identifier&)
150 JSSQLError* castedThis = static_cast<JSSQLError*>(asObject(slotBase));
152 SQLError* imp = static_cast<SQLError*>(castedThis->impl());
153 JSValue result = jsNumber(imp->code());
158 JSValue jsSQLErrorMessage(ExecState* exec, JSValue slotBase, const Identifier&)
160 JSSQLError* castedThis = static_cast<JSSQLError*>(asObject(slotBase));
162 SQLError* imp = static_cast<SQLError*>(castedThis->impl());
163 JSValue result = jsString(exec, imp->message());
170 JSValue jsSQLErrorUNKNOWN_ERR(ExecState* exec, JSValue, const Identifier&)
173 return jsNumber(static_cast<int>(0));
176 JSValue jsSQLErrorDATABASE_ERR(ExecState* exec, JSValue, const Identifier&)
179 return jsNumber(static_cast<int>(1));
182 JSValue jsSQLErrorVERSION_ERR(ExecState* exec, JSValue, const Identifier&)
185 return jsNumber(static_cast<int>(2));
188 JSValue jsSQLErrorTOO_LARGE_ERR(ExecState* exec, JSValue, const Identifier&)
191 return jsNumber(static_cast<int>(3));
194 JSValue jsSQLErrorQUOTA_ERR(ExecState* exec, JSValue, const Identifier&)
197 return jsNumber(static_cast<int>(4));
200 JSValue jsSQLErrorSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&)
203 return jsNumber(static_cast<int>(5));
206 JSValue jsSQLErrorCONSTRAINT_ERR(ExecState* exec, JSValue, const Identifier&)
209 return jsNumber(static_cast<int>(6));
212 JSValue jsSQLErrorTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&)
215 return jsNumber(static_cast<int>(7));
218 static inline bool isObservable(JSSQLError* jsSQLError)
220 if (jsSQLError->hasCustomProperties())
225 bool JSSQLErrorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
227 JSSQLError* jsSQLError = static_cast<JSSQLError*>(handle.get().asCell());
228 if (!isObservable(jsSQLError))
230 UNUSED_PARAM(visitor);
234 void JSSQLErrorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
236 JSSQLError* jsSQLError = static_cast<JSSQLError*>(handle.get().asCell());
237 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
238 uncacheWrapper(world, jsSQLError->impl(), jsSQLError);
239 jsSQLError->releaseImpl();
242 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SQLError* impl)
244 return wrap<JSSQLError>(exec, globalObject, impl);
247 SQLError* toSQLError(JSC::JSValue value)
249 return value.inherits(&JSSQLError::s_info) ? static_cast<JSSQLError*>(asObject(value))->impl() : 0;
254 #endif // ENABLE(SQL_DATABASE)