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 "JSHTMLOptionsCollection.h"
24 #include "HTMLOptionsCollection.h"
25 #include <runtime/Error.h>
26 #include <wtf/GetPtr.h>
32 ASSERT_CLASS_FITS_IN_CELL(JSHTMLOptionsCollection);
36 #define THUNK_GENERATOR(generator) , generator
38 #define THUNK_GENERATOR(generator)
41 #define INTRINSIC(intrinsic) , intrinsic
43 #define INTRINSIC(intrinsic)
46 static const HashTableValue JSHTMLOptionsCollectionTableValues[] =
48 { "selectedIndex", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLOptionsCollectionSelectedIndex), (intptr_t)setJSHTMLOptionsCollectionSelectedIndex THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
49 { "length", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLOptionsCollectionLength), (intptr_t)setJSHTMLOptionsCollectionLength THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLOptionsCollectionConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
54 #undef THUNK_GENERATOR
55 static const HashTable JSHTMLOptionsCollectionTable = { 9, 7, JSHTMLOptionsCollectionTableValues, 0 };
56 /* Hash table for constructor */
58 #define THUNK_GENERATOR(generator) , generator
60 #define THUNK_GENERATOR(generator)
63 #define INTRINSIC(intrinsic) , intrinsic
65 #define INTRINSIC(intrinsic)
68 static const HashTableValue JSHTMLOptionsCollectionConstructorTableValues[] =
70 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
73 #undef THUNK_GENERATOR
74 static const HashTable JSHTMLOptionsCollectionConstructorTable = { 1, 0, JSHTMLOptionsCollectionConstructorTableValues, 0 };
75 const ClassInfo JSHTMLOptionsCollectionConstructor::s_info = { "HTMLOptionsCollectionConstructor", &DOMConstructorObject::s_info, &JSHTMLOptionsCollectionConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLOptionsCollectionConstructor) };
77 JSHTMLOptionsCollectionConstructor::JSHTMLOptionsCollectionConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
78 : DOMConstructorObject(structure, globalObject)
82 void JSHTMLOptionsCollectionConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
84 Base::finishCreation(exec->globalData());
85 ASSERT(inherits(&s_info));
86 putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLOptionsCollectionPrototype::self(exec, globalObject), DontDelete | ReadOnly);
89 bool JSHTMLOptionsCollectionConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
91 return getStaticValueSlot<JSHTMLOptionsCollectionConstructor, JSDOMWrapper>(exec, &JSHTMLOptionsCollectionConstructorTable, static_cast<JSHTMLOptionsCollectionConstructor*>(cell), propertyName, slot);
94 bool JSHTMLOptionsCollectionConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
96 return getStaticValueDescriptor<JSHTMLOptionsCollectionConstructor, JSDOMWrapper>(exec, &JSHTMLOptionsCollectionConstructorTable, static_cast<JSHTMLOptionsCollectionConstructor*>(object), propertyName, descriptor);
99 /* Hash table for prototype */
101 #define THUNK_GENERATOR(generator) , generator
103 #define THUNK_GENERATOR(generator)
106 #define INTRINSIC(intrinsic) , intrinsic
108 #define INTRINSIC(intrinsic)
111 static const HashTableValue JSHTMLOptionsCollectionPrototypeTableValues[] =
113 { "add", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLOptionsCollectionPrototypeFunctionAdd), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
114 { "remove", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLOptionsCollectionPrototypeFunctionRemove), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
115 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
118 #undef THUNK_GENERATOR
119 static const HashTable JSHTMLOptionsCollectionPrototypeTable = { 4, 3, JSHTMLOptionsCollectionPrototypeTableValues, 0 };
120 const ClassInfo JSHTMLOptionsCollectionPrototype::s_info = { "HTMLOptionsCollectionPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLOptionsCollectionPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLOptionsCollectionPrototype) };
122 JSObject* JSHTMLOptionsCollectionPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
124 return getDOMPrototype<JSHTMLOptionsCollection>(exec, globalObject);
127 bool JSHTMLOptionsCollectionPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
129 JSHTMLOptionsCollectionPrototype* thisObject = jsCast<JSHTMLOptionsCollectionPrototype*>(cell);
130 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLOptionsCollectionPrototypeTable, thisObject, propertyName, slot);
133 bool JSHTMLOptionsCollectionPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
135 JSHTMLOptionsCollectionPrototype* thisObject = jsCast<JSHTMLOptionsCollectionPrototype*>(object);
136 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLOptionsCollectionPrototypeTable, thisObject, propertyName, descriptor);
139 const ClassInfo JSHTMLOptionsCollection::s_info = { "HTMLOptionsCollection", &JSHTMLCollection::s_info, &JSHTMLOptionsCollectionTable, 0 , CREATE_METHOD_TABLE(JSHTMLOptionsCollection) };
141 JSHTMLOptionsCollection::JSHTMLOptionsCollection(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLOptionsCollection> impl)
142 : JSHTMLCollection(structure, globalObject, impl)
146 void JSHTMLOptionsCollection::finishCreation(JSGlobalData& globalData)
148 Base::finishCreation(globalData);
149 ASSERT(inherits(&s_info));
152 JSObject* JSHTMLOptionsCollection::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
154 return JSHTMLOptionsCollectionPrototype::create(exec->globalData(), globalObject, JSHTMLOptionsCollectionPrototype::createStructure(exec->globalData(), globalObject, JSHTMLCollectionPrototype::self(exec, globalObject)));
157 bool JSHTMLOptionsCollection::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
159 JSHTMLOptionsCollection* thisObject = jsCast<JSHTMLOptionsCollection*>(cell);
160 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
161 return getStaticValueSlot<JSHTMLOptionsCollection, Base>(exec, &JSHTMLOptionsCollectionTable, thisObject, propertyName, slot);
164 bool JSHTMLOptionsCollection::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
166 JSHTMLOptionsCollection* thisObject = jsCast<JSHTMLOptionsCollection*>(object);
167 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
168 return getStaticValueDescriptor<JSHTMLOptionsCollection, Base>(exec, &JSHTMLOptionsCollectionTable, thisObject, propertyName, descriptor);
171 JSValue jsHTMLOptionsCollectionSelectedIndex(ExecState* exec, JSValue slotBase, const Identifier&)
173 JSHTMLOptionsCollection* castedThis = static_cast<JSHTMLOptionsCollection*>(asObject(slotBase));
175 HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(castedThis->impl());
176 JSValue result = jsNumber(imp->selectedIndex());
181 JSValue jsHTMLOptionsCollectionLength(ExecState* exec, JSValue slotBase, const Identifier&)
183 JSHTMLOptionsCollection* castedThis = static_cast<JSHTMLOptionsCollection*>(asObject(slotBase));
184 return castedThis->length(exec);
188 JSValue jsHTMLOptionsCollectionConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
190 JSHTMLOptionsCollection* domObject = static_cast<JSHTMLOptionsCollection*>(asObject(slotBase));
191 return JSHTMLOptionsCollection::getConstructor(exec, domObject->globalObject());
194 void JSHTMLOptionsCollection::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
196 JSHTMLOptionsCollection* thisObject = jsCast<JSHTMLOptionsCollection*>(cell);
197 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
199 unsigned index = propertyName.toUInt32(ok);
201 thisObject->indexSetter(exec, index, value);
204 lookupPut<JSHTMLOptionsCollection, Base>(exec, propertyName, value, &JSHTMLOptionsCollectionTable, thisObject, slot);
207 void JSHTMLOptionsCollection::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
209 JSHTMLOptionsCollection* thisObject = jsCast<JSHTMLOptionsCollection*>(cell);
210 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
211 thisObject->indexSetter(exec, propertyName, value);
215 void setJSHTMLOptionsCollectionSelectedIndex(ExecState* exec, JSObject* thisObject, JSValue value)
217 JSHTMLOptionsCollection* castedThis = static_cast<JSHTMLOptionsCollection*>(thisObject);
218 HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(castedThis->impl());
219 imp->setSelectedIndex(value.toInt32(exec));
223 void setJSHTMLOptionsCollectionLength(ExecState* exec, JSObject* thisObject, JSValue value)
225 static_cast<JSHTMLOptionsCollection*>(thisObject)->setLength(exec, value);
229 JSValue JSHTMLOptionsCollection::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
231 return getDOMConstructor<JSHTMLOptionsCollectionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
234 EncodedJSValue JSC_HOST_CALL jsHTMLOptionsCollectionPrototypeFunctionAdd(ExecState* exec)
236 JSValue thisValue = exec->hostThisValue();
237 if (!thisValue.inherits(&JSHTMLOptionsCollection::s_info))
238 return throwVMTypeError(exec);
239 JSHTMLOptionsCollection* castedThis = static_cast<JSHTMLOptionsCollection*>(asObject(thisValue));
240 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLOptionsCollection::s_info);
241 return JSValue::encode(castedThis->add(exec));
244 EncodedJSValue JSC_HOST_CALL jsHTMLOptionsCollectionPrototypeFunctionRemove(ExecState* exec)
246 JSValue thisValue = exec->hostThisValue();
247 if (!thisValue.inherits(&JSHTMLOptionsCollection::s_info))
248 return throwVMTypeError(exec);
249 JSHTMLOptionsCollection* castedThis = static_cast<JSHTMLOptionsCollection*>(asObject(thisValue));
250 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLOptionsCollection::s_info);
251 return JSValue::encode(castedThis->remove(exec));
254 HTMLOptionsCollection* toHTMLOptionsCollection(JSC::JSValue value)
256 return value.inherits(&JSHTMLOptionsCollection::s_info) ? static_cast<JSHTMLOptionsCollection*>(asObject(value))->impl() : 0;