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 "JSDOMSettableTokenList.h"
24 #include "DOMSettableTokenList.h"
26 #include <runtime/JSString.h>
27 #include <runtime/PropertyNameArray.h>
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSDOMSettableTokenList);
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 #define INTRINSIC(intrinsic) , intrinsic
45 #define INTRINSIC(intrinsic)
48 static const HashTableValue JSDOMSettableTokenListTableValues[] =
50 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMSettableTokenListValue), (intptr_t)setJSDOMSettableTokenListValue THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMSettableTokenListConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
55 #undef THUNK_GENERATOR
56 static const HashTable JSDOMSettableTokenListTable = { 4, 3, JSDOMSettableTokenListTableValues, 0 };
57 /* Hash table for constructor */
59 #define THUNK_GENERATOR(generator) , generator
61 #define THUNK_GENERATOR(generator)
64 #define INTRINSIC(intrinsic) , intrinsic
66 #define INTRINSIC(intrinsic)
69 static const HashTableValue JSDOMSettableTokenListConstructorTableValues[] =
71 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
74 #undef THUNK_GENERATOR
75 static const HashTable JSDOMSettableTokenListConstructorTable = { 1, 0, JSDOMSettableTokenListConstructorTableValues, 0 };
76 const ClassInfo JSDOMSettableTokenListConstructor::s_info = { "DOMSettableTokenListConstructor", &DOMConstructorObject::s_info, &JSDOMSettableTokenListConstructorTable, 0, CREATE_METHOD_TABLE(JSDOMSettableTokenListConstructor) };
78 JSDOMSettableTokenListConstructor::JSDOMSettableTokenListConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
79 : DOMConstructorObject(structure, globalObject)
83 void JSDOMSettableTokenListConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
85 Base::finishCreation(exec->globalData());
86 ASSERT(inherits(&s_info));
87 putDirect(exec->globalData(), exec->propertyNames().prototype, JSDOMSettableTokenListPrototype::self(exec, globalObject), DontDelete | ReadOnly);
90 bool JSDOMSettableTokenListConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
92 return getStaticValueSlot<JSDOMSettableTokenListConstructor, JSDOMWrapper>(exec, &JSDOMSettableTokenListConstructorTable, static_cast<JSDOMSettableTokenListConstructor*>(cell), propertyName, slot);
95 bool JSDOMSettableTokenListConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
97 return getStaticValueDescriptor<JSDOMSettableTokenListConstructor, JSDOMWrapper>(exec, &JSDOMSettableTokenListConstructorTable, static_cast<JSDOMSettableTokenListConstructor*>(object), propertyName, descriptor);
100 /* Hash table for prototype */
102 #define THUNK_GENERATOR(generator) , generator
104 #define THUNK_GENERATOR(generator)
107 #define INTRINSIC(intrinsic) , intrinsic
109 #define INTRINSIC(intrinsic)
112 static const HashTableValue JSDOMSettableTokenListPrototypeTableValues[] =
114 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
117 #undef THUNK_GENERATOR
118 static const HashTable JSDOMSettableTokenListPrototypeTable = { 1, 0, JSDOMSettableTokenListPrototypeTableValues, 0 };
119 const ClassInfo JSDOMSettableTokenListPrototype::s_info = { "DOMSettableTokenListPrototype", &JSC::JSNonFinalObject::s_info, &JSDOMSettableTokenListPrototypeTable, 0, CREATE_METHOD_TABLE(JSDOMSettableTokenListPrototype) };
121 JSObject* JSDOMSettableTokenListPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
123 return getDOMPrototype<JSDOMSettableTokenList>(exec, globalObject);
126 const ClassInfo JSDOMSettableTokenList::s_info = { "DOMSettableTokenList", &JSDOMTokenList::s_info, &JSDOMSettableTokenListTable, 0 , CREATE_METHOD_TABLE(JSDOMSettableTokenList) };
128 JSDOMSettableTokenList::JSDOMSettableTokenList(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DOMSettableTokenList> impl)
129 : JSDOMTokenList(structure, globalObject, impl)
133 void JSDOMSettableTokenList::finishCreation(JSGlobalData& globalData)
135 Base::finishCreation(globalData);
136 ASSERT(inherits(&s_info));
139 JSObject* JSDOMSettableTokenList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
141 return JSDOMSettableTokenListPrototype::create(exec->globalData(), globalObject, JSDOMSettableTokenListPrototype::createStructure(exec->globalData(), globalObject, JSDOMTokenListPrototype::self(exec, globalObject)));
144 bool JSDOMSettableTokenList::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
146 JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(cell);
147 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
148 const HashEntry* entry = JSDOMSettableTokenListTable.entry(exec, propertyName);
150 slot.setCustom(thisObject, entry->propertyGetter());
154 unsigned index = propertyName.toUInt32(ok);
156 slot.setCustomIndex(thisObject, index, indexGetter);
159 return getStaticValueSlot<JSDOMSettableTokenList, Base>(exec, &JSDOMSettableTokenListTable, thisObject, propertyName, slot);
162 bool JSDOMSettableTokenList::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
164 JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(object);
165 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
166 const HashEntry* entry = JSDOMSettableTokenListTable.entry(exec, propertyName);
169 slot.setCustom(thisObject, entry->propertyGetter());
170 descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
174 unsigned index = propertyName.toUInt32(ok);
175 if (ok && index < static_cast<DOMSettableTokenList*>(thisObject->impl())->length()) {
177 slot.setCustomIndex(thisObject, index, indexGetter);
178 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
181 return getStaticValueDescriptor<JSDOMSettableTokenList, Base>(exec, &JSDOMSettableTokenListTable, thisObject, propertyName, descriptor);
184 bool JSDOMSettableTokenList::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
186 JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(cell);
187 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
188 if (propertyName < static_cast<DOMSettableTokenList*>(thisObject->impl())->length()) {
189 slot.setCustomIndex(thisObject, propertyName, thisObject->indexGetter);
192 return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
195 JSValue jsDOMSettableTokenListValue(ExecState* exec, JSValue slotBase, const Identifier&)
197 JSDOMSettableTokenList* castedThis = static_cast<JSDOMSettableTokenList*>(asObject(slotBase));
199 DOMSettableTokenList* imp = static_cast<DOMSettableTokenList*>(castedThis->impl());
200 JSValue result = jsString(exec, imp->value());
205 JSValue jsDOMSettableTokenListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
207 JSDOMSettableTokenList* domObject = static_cast<JSDOMSettableTokenList*>(asObject(slotBase));
208 return JSDOMSettableTokenList::getConstructor(exec, domObject->globalObject());
211 void JSDOMSettableTokenList::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
213 JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(cell);
214 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
215 lookupPut<JSDOMSettableTokenList, Base>(exec, propertyName, value, &JSDOMSettableTokenListTable, thisObject, slot);
218 void setJSDOMSettableTokenListValue(ExecState* exec, JSObject* thisObject, JSValue value)
220 JSDOMSettableTokenList* castedThis = static_cast<JSDOMSettableTokenList*>(thisObject);
221 DOMSettableTokenList* imp = static_cast<DOMSettableTokenList*>(castedThis->impl());
222 imp->setValue(ustringToString(value.isEmpty() ? UString() : value.toString(exec)));
226 void JSDOMSettableTokenList::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
228 JSDOMSettableTokenList* thisObject = jsCast<JSDOMSettableTokenList*>(object);
229 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
230 for (unsigned i = 0; i < static_cast<DOMSettableTokenList*>(thisObject->impl())->length(); ++i)
231 propertyNames.add(Identifier::from(exec, i));
232 Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
235 JSValue JSDOMSettableTokenList::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
237 return getDOMConstructor<JSDOMSettableTokenListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
241 JSValue JSDOMSettableTokenList::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
243 JSDOMSettableTokenList* thisObj = static_cast<JSDOMSettableTokenList*>(asObject(slotBase));
244 ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
245 return jsStringOrNull(exec, thisObj->impl()->item(index));
248 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMSettableTokenList* impl)
250 return wrap<JSDOMSettableTokenList>(exec, globalObject, impl);