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.
25 #include "JSSVGElementInstanceList.h"
27 #include "ExceptionCode.h"
28 #include "JSDOMBinding.h"
29 #include "JSSVGElementInstance.h"
30 #include "SVGElementInstance.h"
31 #include "SVGElementInstanceList.h"
32 #include <runtime/Error.h>
33 #include <wtf/GetPtr.h>
39 ASSERT_CLASS_FITS_IN_CELL(JSSVGElementInstanceList);
43 #define THUNK_GENERATOR(generator) , generator
45 #define THUNK_GENERATOR(generator)
48 #define INTRINSIC(intrinsic) , intrinsic
50 #define INTRINSIC(intrinsic)
53 static const HashTableValue JSSVGElementInstanceListTableValues[] =
55 { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementInstanceListLength), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementInstanceListConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
60 #undef THUNK_GENERATOR
61 static const HashTable JSSVGElementInstanceListTable = { 5, 3, JSSVGElementInstanceListTableValues, 0 };
62 /* Hash table for constructor */
64 #define THUNK_GENERATOR(generator) , generator
66 #define THUNK_GENERATOR(generator)
69 #define INTRINSIC(intrinsic) , intrinsic
71 #define INTRINSIC(intrinsic)
74 static const HashTableValue JSSVGElementInstanceListConstructorTableValues[] =
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
79 #undef THUNK_GENERATOR
80 static const HashTable JSSVGElementInstanceListConstructorTable = { 1, 0, JSSVGElementInstanceListConstructorTableValues, 0 };
81 const ClassInfo JSSVGElementInstanceListConstructor::s_info = { "SVGElementInstanceListConstructor", &DOMConstructorObject::s_info, &JSSVGElementInstanceListConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGElementInstanceListConstructor) };
83 JSSVGElementInstanceListConstructor::JSSVGElementInstanceListConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84 : DOMConstructorObject(structure, globalObject)
88 void JSSVGElementInstanceListConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
90 Base::finishCreation(exec->globalData());
91 ASSERT(inherits(&s_info));
92 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGElementInstanceListPrototype::self(exec, globalObject), DontDelete | ReadOnly);
95 bool JSSVGElementInstanceListConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
97 return getStaticValueSlot<JSSVGElementInstanceListConstructor, JSDOMWrapper>(exec, &JSSVGElementInstanceListConstructorTable, static_cast<JSSVGElementInstanceListConstructor*>(cell), propertyName, slot);
100 bool JSSVGElementInstanceListConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
102 return getStaticValueDescriptor<JSSVGElementInstanceListConstructor, JSDOMWrapper>(exec, &JSSVGElementInstanceListConstructorTable, static_cast<JSSVGElementInstanceListConstructor*>(object), propertyName, descriptor);
105 /* Hash table for prototype */
107 #define THUNK_GENERATOR(generator) , generator
109 #define THUNK_GENERATOR(generator)
112 #define INTRINSIC(intrinsic) , intrinsic
114 #define INTRINSIC(intrinsic)
117 static const HashTableValue JSSVGElementInstanceListPrototypeTableValues[] =
119 { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGElementInstanceListPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
120 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
123 #undef THUNK_GENERATOR
124 static const HashTable JSSVGElementInstanceListPrototypeTable = { 2, 1, JSSVGElementInstanceListPrototypeTableValues, 0 };
125 const ClassInfo JSSVGElementInstanceListPrototype::s_info = { "SVGElementInstanceListPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGElementInstanceListPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGElementInstanceListPrototype) };
127 JSObject* JSSVGElementInstanceListPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
129 return getDOMPrototype<JSSVGElementInstanceList>(exec, globalObject);
132 bool JSSVGElementInstanceListPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
134 JSSVGElementInstanceListPrototype* thisObject = jsCast<JSSVGElementInstanceListPrototype*>(cell);
135 return getStaticFunctionSlot<JSObject>(exec, &JSSVGElementInstanceListPrototypeTable, thisObject, propertyName, slot);
138 bool JSSVGElementInstanceListPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
140 JSSVGElementInstanceListPrototype* thisObject = jsCast<JSSVGElementInstanceListPrototype*>(object);
141 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGElementInstanceListPrototypeTable, thisObject, propertyName, descriptor);
144 const ClassInfo JSSVGElementInstanceList::s_info = { "SVGElementInstanceList", &JSDOMWrapper::s_info, &JSSVGElementInstanceListTable, 0 , CREATE_METHOD_TABLE(JSSVGElementInstanceList) };
146 JSSVGElementInstanceList::JSSVGElementInstanceList(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGElementInstanceList> impl)
147 : JSDOMWrapper(structure, globalObject)
148 , m_impl(impl.leakRef())
152 void JSSVGElementInstanceList::finishCreation(JSGlobalData& globalData)
154 Base::finishCreation(globalData);
155 ASSERT(inherits(&s_info));
158 JSObject* JSSVGElementInstanceList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
160 return JSSVGElementInstanceListPrototype::create(exec->globalData(), globalObject, JSSVGElementInstanceListPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
163 bool JSSVGElementInstanceList::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
165 JSSVGElementInstanceList* thisObject = jsCast<JSSVGElementInstanceList*>(cell);
166 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
167 return getStaticValueSlot<JSSVGElementInstanceList, Base>(exec, &JSSVGElementInstanceListTable, thisObject, propertyName, slot);
170 bool JSSVGElementInstanceList::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
172 JSSVGElementInstanceList* thisObject = jsCast<JSSVGElementInstanceList*>(object);
173 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
174 return getStaticValueDescriptor<JSSVGElementInstanceList, Base>(exec, &JSSVGElementInstanceListTable, thisObject, propertyName, descriptor);
177 JSValue jsSVGElementInstanceListLength(ExecState* exec, JSValue slotBase, const Identifier&)
179 JSSVGElementInstanceList* castedThis = static_cast<JSSVGElementInstanceList*>(asObject(slotBase));
181 SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(castedThis->impl());
182 JSValue result = jsNumber(imp->length());
187 JSValue jsSVGElementInstanceListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
189 JSSVGElementInstanceList* domObject = static_cast<JSSVGElementInstanceList*>(asObject(slotBase));
190 return JSSVGElementInstanceList::getConstructor(exec, domObject->globalObject());
193 JSValue JSSVGElementInstanceList::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
195 return getDOMConstructor<JSSVGElementInstanceListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
198 EncodedJSValue JSC_HOST_CALL jsSVGElementInstanceListPrototypeFunctionItem(ExecState* exec)
200 JSValue thisValue = exec->hostThisValue();
201 if (!thisValue.inherits(&JSSVGElementInstanceList::s_info))
202 return throwVMTypeError(exec);
203 JSSVGElementInstanceList* castedThis = static_cast<JSSVGElementInstanceList*>(asObject(thisValue));
204 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGElementInstanceList::s_info);
205 SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(castedThis->impl());
206 unsigned index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
207 if (exec->hadException())
208 return JSValue::encode(jsUndefined());
210 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index)));
211 return JSValue::encode(result);
214 static inline bool isObservable(JSSVGElementInstanceList* jsSVGElementInstanceList)
216 if (jsSVGElementInstanceList->hasCustomProperties())
221 bool JSSVGElementInstanceListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
223 JSSVGElementInstanceList* jsSVGElementInstanceList = static_cast<JSSVGElementInstanceList*>(handle.get().asCell());
224 if (!isObservable(jsSVGElementInstanceList))
226 UNUSED_PARAM(visitor);
230 void JSSVGElementInstanceListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
232 JSSVGElementInstanceList* jsSVGElementInstanceList = static_cast<JSSVGElementInstanceList*>(handle.get().asCell());
233 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
234 uncacheWrapper(world, jsSVGElementInstanceList->impl(), jsSVGElementInstanceList);
235 jsSVGElementInstanceList->releaseImpl();
238 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGElementInstanceList* impl)
240 return wrap<JSSVGElementInstanceList>(exec, globalObject, impl);
243 SVGElementInstanceList* toSVGElementInstanceList(JSC::JSValue value)
245 return value.inherits(&JSSVGElementInstanceList::s_info) ? static_cast<JSSVGElementInstanceList*>(asObject(value))->impl() : 0;
250 #endif // ENABLE(SVG)