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(Condition1) || ENABLE(Condition2)
25 #include "JSTestInterface.h"
27 #include "TestInterface.h"
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSTestInterface);
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 static const HashTableValue JSTestInterfaceTableValues[] =
45 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
46 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
49 #undef THUNK_GENERATOR
50 static JSC_CONST_HASHTABLE HashTable JSTestInterfaceTable = { 2, 1, JSTestInterfaceTableValues, 0 };
51 /* Hash table for constructor */
53 #define THUNK_GENERATOR(generator) , generator
55 #define THUNK_GENERATOR(generator)
58 static const HashTableValue JSTestInterfaceConstructorTableValues[] =
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
63 #undef THUNK_GENERATOR
64 static JSC_CONST_HASHTABLE HashTable JSTestInterfaceConstructorTable = { 1, 0, JSTestInterfaceConstructorTableValues, 0 };
65 class JSTestInterfaceConstructor : public DOMConstructorObject {
67 JSTestInterfaceConstructor(JSC::Structure*, JSDOMGlobalObject*);
68 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
71 typedef DOMConstructorObject Base;
72 static JSTestInterfaceConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
74 JSTestInterfaceConstructor* ptr = new (JSC::allocateCell<JSTestInterfaceConstructor>(*exec->heap())) JSTestInterfaceConstructor(structure, globalObject);
75 ptr->finishCreation(exec, globalObject);
79 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
80 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
81 static const JSC::ClassInfo s_info;
82 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
84 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
87 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
88 static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestInterface(JSC::ExecState*);
89 virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
92 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestInterfaceConstructorTable, 0 };
94 JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
95 : DOMConstructorObject(structure, globalObject)
99 void JSTestInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
101 Base::finishCreation(exec->globalData());
102 ASSERT(inherits(&s_info));
103 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
106 bool JSTestInterfaceConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
108 return getStaticValueSlot<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, this, propertyName, slot);
111 bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
113 return getStaticValueDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, this, propertyName, descriptor);
116 EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* exec)
118 ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext();
120 return throwVMError(exec, createReferenceError(exec, "Reference error"));
121 return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context))));
124 ConstructType JSTestInterfaceConstructor::getConstructData(ConstructData& constructData)
126 constructData.native.function = constructJSTestInterface;
127 return ConstructTypeHost;
130 /* Hash table for prototype */
132 #define THUNK_GENERATOR(generator) , generator
134 #define THUNK_GENERATOR(generator)
137 static const HashTableValue JSTestInterfacePrototypeTableValues[] =
139 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
142 #undef THUNK_GENERATOR
143 static JSC_CONST_HASHTABLE HashTable JSTestInterfacePrototypeTable = { 1, 0, JSTestInterfacePrototypeTableValues, 0 };
144 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &JSC::JSNonFinalObject::s_info, &JSTestInterfacePrototypeTable, 0 };
146 JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
148 return getDOMPrototype<JSTestInterface>(exec, globalObject);
151 const ClassInfo JSTestInterface::s_info = { "TestInterface", &JSDOMWrapper::s_info, &JSTestInterfaceTable, 0 };
153 JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
154 : JSDOMWrapper(structure, globalObject)
159 void JSTestInterface::finishCreation(JSGlobalData& globalData)
161 Base::finishCreation(globalData);
162 ASSERT(inherits(&s_info));
165 JSObject* JSTestInterface::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
167 return JSTestInterfacePrototype::create(exec->globalData(), globalObject, JSTestInterfacePrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
170 bool JSTestInterface::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
172 ASSERT_GC_OBJECT_INHERITS(this, &s_info);
173 return getStaticValueSlot<JSTestInterface, Base>(exec, &JSTestInterfaceTable, this, propertyName, slot);
176 bool JSTestInterface::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
178 ASSERT_GC_OBJECT_INHERITS(this, &s_info);
179 return getStaticValueDescriptor<JSTestInterface, Base>(exec, &JSTestInterfaceTable, this, propertyName, descriptor);
182 JSValue jsTestInterfaceConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
184 JSTestInterface* domObject = static_cast<JSTestInterface*>(asObject(slotBase));
185 return JSTestInterface::getConstructor(exec, domObject->globalObject());
188 JSValue JSTestInterface::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
190 return getDOMConstructor<JSTestInterfaceConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
193 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInterface* impl)
195 return wrap<JSTestInterface>(exec, globalObject, impl);
198 TestInterface* toTestInterface(JSC::JSValue value)
200 return value.inherits(&JSTestInterface::s_info) ? static_cast<JSTestInterface*>(asObject(value))->impl() : 0;
205 #endif // ENABLE(Condition1) || ENABLE(Condition2)