1/* 2 This file is part of the WebKit open source project. 3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! 4 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. 9 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. 14 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. 19*/ 20 21#include "config.h" 22#include "JSTestNode.h" 23 24#include "ExceptionCode.h" 25#include "JSDOMBinding.h" 26#include "TestNode.h" 27#include <runtime/Error.h> 28#include <wtf/GetPtr.h> 29 30using namespace JSC; 31 32namespace WebCore { 33 34// Attributes 35 36JSC::EncodedJSValue jsTestNodeConstructor(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName); 37 38class JSTestNodePrototype : public JSC::JSNonFinalObject { 39public: 40 typedef JSC::JSNonFinalObject Base; 41 static JSTestNodePrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) 42 { 43 JSTestNodePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNodePrototype>(vm.heap)) JSTestNodePrototype(vm, globalObject, structure); 44 ptr->finishCreation(vm); 45 return ptr; 46 } 47 48 DECLARE_INFO; 49 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 50 { 51 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); 52 } 53 54private: 55 JSTestNodePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) 56 : JSC::JSNonFinalObject(vm, structure) 57 { 58 } 59 60 void finishCreation(JSC::VM&); 61}; 62 63class JSTestNodeConstructor : public DOMConstructorObject { 64private: 65 JSTestNodeConstructor(JSC::Structure*, JSDOMGlobalObject*); 66 void finishCreation(JSC::VM&, JSDOMGlobalObject*); 67 68public: 69 typedef DOMConstructorObject Base; 70 static JSTestNodeConstructor* create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject* globalObject) 71 { 72 JSTestNodeConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestNodeConstructor>(vm.heap)) JSTestNodeConstructor(structure, globalObject); 73 ptr->finishCreation(vm, globalObject); 74 return ptr; 75 } 76 77 DECLARE_INFO; 78 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 79 { 80 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); 81 } 82protected: 83 static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestNode(JSC::ExecState*); 84 static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&); 85}; 86 87EncodedJSValue JSC_HOST_CALL JSTestNodeConstructor::constructJSTestNode(ExecState* exec) 88{ 89 JSTestNodeConstructor* castedThis = jsCast<JSTestNodeConstructor*>(exec->callee()); 90 RefPtr<TestNode> object = TestNode::create(); 91 return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get()))); 92} 93 94const ClassInfo JSTestNodeConstructor::s_info = { "TestNodeConstructor", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSTestNodeConstructor) }; 95 96JSTestNodeConstructor::JSTestNodeConstructor(Structure* structure, JSDOMGlobalObject* globalObject) 97 : DOMConstructorObject(structure, globalObject) 98{ 99} 100 101void JSTestNodeConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject) 102{ 103 Base::finishCreation(vm); 104 ASSERT(inherits(info())); 105 putDirect(vm, vm.propertyNames->prototype, JSTestNode::getPrototype(vm, globalObject), DontDelete | ReadOnly); 106 putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum); 107} 108 109ConstructType JSTestNodeConstructor::getConstructData(JSCell*, ConstructData& constructData) 110{ 111 constructData.native.function = constructJSTestNode; 112 return ConstructTypeHost; 113} 114 115/* Hash table for prototype */ 116 117static const HashTableValue JSTestNodePrototypeTableValues[] = 118{ 119 { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNodeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, 120}; 121 122const ClassInfo JSTestNodePrototype::s_info = { "TestNodePrototype", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSTestNodePrototype) }; 123 124void JSTestNodePrototype::finishCreation(VM& vm) 125{ 126 Base::finishCreation(vm); 127 reifyStaticProperties(vm, JSTestNodePrototypeTableValues, *this); 128} 129 130const ClassInfo JSTestNode::s_info = { "TestNode", &Base::s_info, 0, 0 , CREATE_METHOD_TABLE(JSTestNode) }; 131 132JSTestNode::JSTestNode(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestNode> impl) 133 : JSNode(structure, globalObject, impl) 134{ 135} 136 137JSObject* JSTestNode::createPrototype(VM& vm, JSGlobalObject* globalObject) 138{ 139 return JSTestNodePrototype::create(vm, globalObject, JSTestNodePrototype::createStructure(vm, globalObject, JSNode::getPrototype(vm, globalObject))); 140} 141 142JSObject* JSTestNode::getPrototype(VM& vm, JSGlobalObject* globalObject) 143{ 144 return getDOMPrototype<JSTestNode>(vm, globalObject); 145} 146 147EncodedJSValue jsTestNodeConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName) 148{ 149 JSTestNodePrototype* domObject = jsDynamicCast<JSTestNodePrototype*>(baseValue); 150 if (!domObject) 151 return throwVMTypeError(exec); 152 return JSValue::encode(JSTestNode::getConstructor(exec->vm(), domObject->globalObject())); 153} 154 155JSValue JSTestNode::getConstructor(VM& vm, JSGlobalObject* globalObject) 156{ 157 return getDOMConstructor<JSTestNodeConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject)); 158} 159 160void JSTestNode::visitChildren(JSCell* cell, SlotVisitor& visitor) 161{ 162 JSTestNode* thisObject = jsCast<JSTestNode*>(cell); 163 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 164 COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); 165 ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); 166 Base::visitChildren(thisObject, visitor); 167 thisObject->impl().visitJSEventListeners(visitor); 168} 169 170 171} 172