21
21
#include "config.h"
23
25
#include "JSSQLResultSetRowList.h"
25
#include <wtf/GetPtr.h>
27
27
#include "SQLResultSetRowList.h"
29
28
#include <runtime/Error.h>
30
29
#include <runtime/JSNumberCell.h>
30
#include <wtf/GetPtr.h>
32
32
using namespace JSC;
34
34
namespace WebCore {
36
ASSERT_CLASS_FITS_IN_CELL(JSSQLResultSetRowList)
36
ASSERT_CLASS_FITS_IN_CELL(JSSQLResultSetRowList);
77
77
return getStaticFunctionSlot<JSObject>(exec, &JSSQLResultSetRowListPrototypeTable, this, propertyName, slot);
80
bool JSSQLResultSetRowListPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
82
return getStaticFunctionDescriptor<JSObject>(exec, &JSSQLResultSetRowListPrototypeTable, this, propertyName, descriptor);
80
85
const ClassInfo JSSQLResultSetRowList::s_info = { "SQLResultSetRowList", 0, &JSSQLResultSetRowListTable, 0 };
82
JSSQLResultSetRowList::JSSQLResultSetRowList(PassRefPtr<Structure> structure, PassRefPtr<SQLResultSetRowList> impl)
83
: DOMObject(structure)
87
JSSQLResultSetRowList::JSSQLResultSetRowList(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SQLResultSetRowList> impl)
88
: DOMObjectWithGlobalPointer(structure, globalObject)
88
93
JSSQLResultSetRowList::~JSSQLResultSetRowList()
90
forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
95
forgetDOMObject(*Heap::heap(this)->globalData(), impl());
94
98
JSObject* JSSQLResultSetRowList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
101
105
return getStaticValueSlot<JSSQLResultSetRowList, Base>(exec, &JSSQLResultSetRowListTable, this, propertyName, slot);
104
JSValuePtr jsSQLResultSetRowListLength(ExecState* exec, const Identifier&, const PropertySlot& slot)
106
SQLResultSetRowList* imp = static_cast<SQLResultSetRowList*>(static_cast<JSSQLResultSetRowList*>(asObject(slot.slotBase()))->impl());
108
bool JSSQLResultSetRowList::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
110
return getStaticValueDescriptor<JSSQLResultSetRowList, Base>(exec, &JSSQLResultSetRowListTable, this, propertyName, descriptor);
113
JSValue jsSQLResultSetRowListLength(ExecState* exec, const Identifier&, const PropertySlot& slot)
115
JSSQLResultSetRowList* castedThis = static_cast<JSSQLResultSetRowList*>(asObject(slot.slotBase()));
117
SQLResultSetRowList* imp = static_cast<SQLResultSetRowList*>(castedThis->impl());
107
118
return jsNumber(exec, imp->length());
110
JSValuePtr jsSQLResultSetRowListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
121
JSValue JSC_HOST_CALL jsSQLResultSetRowListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
112
if (!thisValue->isObject(&JSSQLResultSetRowList::s_info))
124
if (!thisValue.inherits(&JSSQLResultSetRowList::s_info))
113
125
return throwError(exec, TypeError);
114
126
JSSQLResultSetRowList* castedThisObj = static_cast<JSSQLResultSetRowList*>(asObject(thisValue));
115
127
return castedThisObj->item(exec, args);
118
JSC::JSValuePtr toJS(JSC::ExecState* exec, SQLResultSetRowList* object)
120
return getDOMObjectWrapper<JSSQLResultSetRowList>(exec, object);
122
SQLResultSetRowList* toSQLResultSetRowList(JSC::JSValuePtr value)
124
return value->isObject(&JSSQLResultSetRowList::s_info) ? static_cast<JSSQLResultSetRowList*>(asObject(value))->impl() : 0;
130
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SQLResultSetRowList* object)
132
return getDOMObjectWrapper<JSSQLResultSetRowList>(exec, globalObject, object);
134
SQLResultSetRowList* toSQLResultSetRowList(JSC::JSValue value)
136
return value.inherits(&JSSQLResultSetRowList::s_info) ? static_cast<JSSQLResultSetRowList*>(asObject(value))->impl() : 0;
141
#endif // ENABLE(DATABASE)