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 "JSTestNamedConstructor.h"
24 #include "ExceptionCode.h"
25 #include "JSDOMBinding.h"
26 #include "TestNamedConstructor.h"
27 #include <runtime/Error.h>
28 #include <wtf/GetPtr.h>
34 ASSERT_CLASS_FITS_IN_CELL(JSTestNamedConstructor);
36 /* Hash table for constructor */
38 #define THUNK_GENERATOR(generator) , generator
40 #define THUNK_GENERATOR(generator)
43 #define INTRINSIC(intrinsic) , intrinsic
45 #define INTRINSIC(intrinsic)
48 static const HashTableValue JSTestNamedConstructorTableValues[] =
50 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedConstructorConstructor), (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 JSTestNamedConstructorTable = { 2, 1, JSTestNamedConstructorTableValues, 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 JSTestNamedConstructorConstructorTableValues[] =
70 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
73 #undef THUNK_GENERATOR
74 static const HashTable JSTestNamedConstructorConstructorTable = { 1, 0, JSTestNamedConstructorConstructorTableValues, 0 };
75 const ClassInfo JSTestNamedConstructorConstructor::s_info = { "TestNamedConstructorConstructor", &DOMConstructorObject::s_info, &JSTestNamedConstructorConstructorTable, 0, CREATE_METHOD_TABLE(JSTestNamedConstructorConstructor) };
77 JSTestNamedConstructorConstructor::JSTestNamedConstructorConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
78 : DOMConstructorObject(structure, globalObject)
82 void JSTestNamedConstructorConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
84 Base::finishCreation(exec->globalData());
85 ASSERT(inherits(&s_info));
86 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestNamedConstructorPrototype::self(exec, globalObject), DontDelete | ReadOnly);
89 bool JSTestNamedConstructorConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
91 return getStaticValueSlot<JSTestNamedConstructorConstructor, JSDOMWrapper>(exec, &JSTestNamedConstructorConstructorTable, static_cast<JSTestNamedConstructorConstructor*>(cell), propertyName, slot);
94 bool JSTestNamedConstructorConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
96 return getStaticValueDescriptor<JSTestNamedConstructorConstructor, JSDOMWrapper>(exec, &JSTestNamedConstructorConstructorTable, static_cast<JSTestNamedConstructorConstructor*>(object), propertyName, descriptor);
99 const ClassInfo JSTestNamedConstructorNamedConstructor::s_info = { "TestNamedConstructorConstructor", &DOMConstructorObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSTestNamedConstructorNamedConstructor) };
101 JSTestNamedConstructorNamedConstructor::JSTestNamedConstructorNamedConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
102 : DOMConstructorWithDocument(structure, globalObject)
106 void JSTestNamedConstructorNamedConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
108 Base::finishCreation(globalObject);
109 ASSERT(inherits(&s_info));
110 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestNamedConstructorPrototype::self(exec, globalObject), None);
113 EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor(ExecState* exec)
115 JSTestNamedConstructorNamedConstructor* jsConstructor = static_cast<JSTestNamedConstructorNamedConstructor*>(exec->callee());
116 if (exec->argumentCount() < 1)
117 return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
118 ExceptionCode ec = 0;
119 const String& str1(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
120 if (exec->hadException())
121 return JSValue::encode(jsUndefined());
122 const String& str2(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toString(exec)));
123 if (exec->hadException())
124 return JSValue::encode(jsUndefined());
125 const String& str3(ustringToString(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsEmpty).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 2, MissingIsEmpty).toString(exec)));
126 if (exec->hadException())
127 return JSValue::encode(jsUndefined());
128 RefPtr<TestNamedConstructor> object = TestNamedConstructor::createForJSConstructor(jsConstructor->document(), str1, str2, str3, ec);
130 setDOMException(exec, ec);
131 return JSValue::encode(JSValue());
133 return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), object.get())));
136 ConstructType JSTestNamedConstructorNamedConstructor::getConstructData(JSCell*, ConstructData& constructData)
138 constructData.native.function = constructJSTestNamedConstructor;
139 return ConstructTypeHost;
142 /* Hash table for prototype */
144 #define THUNK_GENERATOR(generator) , generator
146 #define THUNK_GENERATOR(generator)
149 #define INTRINSIC(intrinsic) , intrinsic
151 #define INTRINSIC(intrinsic)
154 static const HashTableValue JSTestNamedConstructorPrototypeTableValues[] =
156 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
159 #undef THUNK_GENERATOR
160 static const HashTable JSTestNamedConstructorPrototypeTable = { 1, 0, JSTestNamedConstructorPrototypeTableValues, 0 };
161 const ClassInfo JSTestNamedConstructorPrototype::s_info = { "TestNamedConstructorPrototype", &JSC::JSNonFinalObject::s_info, &JSTestNamedConstructorPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestNamedConstructorPrototype) };
163 JSObject* JSTestNamedConstructorPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
165 return getDOMPrototype<JSTestNamedConstructor>(exec, globalObject);
168 const ClassInfo JSTestNamedConstructor::s_info = { "TestNamedConstructor", &JSDOMWrapper::s_info, &JSTestNamedConstructorTable, 0 , CREATE_METHOD_TABLE(JSTestNamedConstructor) };
170 JSTestNamedConstructor::JSTestNamedConstructor(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestNamedConstructor> impl)
171 : JSDOMWrapper(structure, globalObject)
172 , m_impl(impl.leakRef())
176 void JSTestNamedConstructor::finishCreation(JSGlobalData& globalData)
178 Base::finishCreation(globalData);
179 ASSERT(inherits(&s_info));
182 JSObject* JSTestNamedConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
184 return JSTestNamedConstructorPrototype::create(exec->globalData(), globalObject, JSTestNamedConstructorPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
187 bool JSTestNamedConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
189 JSTestNamedConstructor* thisObject = jsCast<JSTestNamedConstructor*>(cell);
190 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
191 return getStaticValueSlot<JSTestNamedConstructor, Base>(exec, &JSTestNamedConstructorTable, thisObject, propertyName, slot);
194 bool JSTestNamedConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
196 JSTestNamedConstructor* thisObject = jsCast<JSTestNamedConstructor*>(object);
197 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
198 return getStaticValueDescriptor<JSTestNamedConstructor, Base>(exec, &JSTestNamedConstructorTable, thisObject, propertyName, descriptor);
201 JSValue jsTestNamedConstructorConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
203 JSTestNamedConstructor* domObject = static_cast<JSTestNamedConstructor*>(asObject(slotBase));
204 return JSTestNamedConstructor::getConstructor(exec, domObject->globalObject());
207 JSValue JSTestNamedConstructor::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
209 return getDOMConstructor<JSTestNamedConstructorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
212 static inline bool isObservable(JSTestNamedConstructor* jsTestNamedConstructor)
214 if (jsTestNamedConstructor->hasCustomProperties())
219 bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
221 JSTestNamedConstructor* jsTestNamedConstructor = static_cast<JSTestNamedConstructor*>(handle.get().asCell());
222 if (jsTestNamedConstructor->impl()->hasPendingActivity())
224 if (!isObservable(jsTestNamedConstructor))
226 UNUSED_PARAM(visitor);
230 void JSTestNamedConstructorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
232 JSTestNamedConstructor* jsTestNamedConstructor = static_cast<JSTestNamedConstructor*>(handle.get().asCell());
233 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
234 uncacheWrapper(world, jsTestNamedConstructor->impl(), jsTestNamedConstructor);
235 jsTestNamedConstructor->releaseImpl();
238 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestNamedConstructor* impl)
240 return wrap<JSTestNamedConstructor>(exec, globalObject, impl);
243 TestNamedConstructor* toTestNamedConstructor(JSC::JSValue value)
245 return value.inherits(&JSTestNamedConstructor::s_info) ? static_cast<JSTestNamedConstructor*>(asObject(value))->impl() : 0;