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 "JSTestCustomNamedGetter.h"
24
#include "ExceptionCode.h"
25
#include "JSDOMBinding.h"
26
#include "TestCustomNamedGetter.h"
27
#include "wtf/text/AtomicString.h"
28
#include <runtime/Error.h>
29
#include <wtf/GetPtr.h>
37
static const HashTableValue JSTestCustomNamedGetterTableValues[] =
39
{ "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCustomNamedGetterConstructor), (intptr_t)0, NoIntrinsic },
40
{ 0, 0, 0, 0, NoIntrinsic }
43
static const HashTable JSTestCustomNamedGetterTable = { 2, 1, JSTestCustomNamedGetterTableValues, 0 };
44
/* Hash table for constructor */
46
static const HashTableValue JSTestCustomNamedGetterConstructorTableValues[] =
48
{ 0, 0, 0, 0, NoIntrinsic }
51
static const HashTable JSTestCustomNamedGetterConstructorTable = { 1, 0, JSTestCustomNamedGetterConstructorTableValues, 0 };
52
const ClassInfo JSTestCustomNamedGetterConstructor::s_info = { "TestCustomNamedGetterConstructor", &Base::s_info, &JSTestCustomNamedGetterConstructorTable, 0, CREATE_METHOD_TABLE(JSTestCustomNamedGetterConstructor) };
54
JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
55
: DOMConstructorObject(structure, globalObject)
59
void JSTestCustomNamedGetterConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
61
Base::finishCreation(exec->globalData());
62
ASSERT(inherits(&s_info));
63
putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestCustomNamedGetterPrototype::self(exec, globalObject), DontDelete | ReadOnly);
66
bool JSTestCustomNamedGetterConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
68
return getStaticValueSlot<JSTestCustomNamedGetterConstructor, JSDOMWrapper>(exec, &JSTestCustomNamedGetterConstructorTable, jsCast<JSTestCustomNamedGetterConstructor*>(cell), propertyName, slot);
71
bool JSTestCustomNamedGetterConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
73
return getStaticValueDescriptor<JSTestCustomNamedGetterConstructor, JSDOMWrapper>(exec, &JSTestCustomNamedGetterConstructorTable, jsCast<JSTestCustomNamedGetterConstructor*>(object), propertyName, descriptor);
76
/* Hash table for prototype */
78
static const HashTableValue JSTestCustomNamedGetterPrototypeTableValues[] =
80
{ "anotherFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestCustomNamedGetterPrototypeFunctionAnotherFunction), (intptr_t)1, NoIntrinsic },
81
{ 0, 0, 0, 0, NoIntrinsic }
84
static const HashTable JSTestCustomNamedGetterPrototypeTable = { 2, 1, JSTestCustomNamedGetterPrototypeTableValues, 0 };
85
const ClassInfo JSTestCustomNamedGetterPrototype::s_info = { "TestCustomNamedGetterPrototype", &Base::s_info, &JSTestCustomNamedGetterPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestCustomNamedGetterPrototype) };
87
JSObject* JSTestCustomNamedGetterPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
89
return getDOMPrototype<JSTestCustomNamedGetter>(exec, globalObject);
92
bool JSTestCustomNamedGetterPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
94
JSTestCustomNamedGetterPrototype* thisObject = jsCast<JSTestCustomNamedGetterPrototype*>(cell);
95
return getStaticFunctionSlot<JSObject>(exec, &JSTestCustomNamedGetterPrototypeTable, thisObject, propertyName, slot);
98
bool JSTestCustomNamedGetterPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
100
JSTestCustomNamedGetterPrototype* thisObject = jsCast<JSTestCustomNamedGetterPrototype*>(object);
101
return getStaticFunctionDescriptor<JSObject>(exec, &JSTestCustomNamedGetterPrototypeTable, thisObject, propertyName, descriptor);
104
const ClassInfo JSTestCustomNamedGetter::s_info = { "TestCustomNamedGetter", &Base::s_info, &JSTestCustomNamedGetterTable, 0 , CREATE_METHOD_TABLE(JSTestCustomNamedGetter) };
106
JSTestCustomNamedGetter::JSTestCustomNamedGetter(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestCustomNamedGetter> impl)
107
: JSDOMWrapper(structure, globalObject)
108
, m_impl(impl.leakRef())
112
void JSTestCustomNamedGetter::finishCreation(JSGlobalData& globalData)
114
Base::finishCreation(globalData);
115
ASSERT(inherits(&s_info));
118
JSObject* JSTestCustomNamedGetter::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
120
return JSTestCustomNamedGetterPrototype::create(exec->globalData(), globalObject, JSTestCustomNamedGetterPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
123
void JSTestCustomNamedGetter::destroy(JSC::JSCell* cell)
125
JSTestCustomNamedGetter* thisObject = static_cast<JSTestCustomNamedGetter*>(cell);
126
thisObject->JSTestCustomNamedGetter::~JSTestCustomNamedGetter();
129
JSTestCustomNamedGetter::~JSTestCustomNamedGetter()
131
releaseImplIfNotNull();
134
bool JSTestCustomNamedGetter::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
136
JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(cell);
137
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
138
if (canGetItemsForName(exec, static_cast<TestCustomNamedGetter*>(thisObject->impl()), propertyName)) {
139
slot.setCustom(thisObject, thisObject->nameGetter);
142
return getStaticValueSlot<JSTestCustomNamedGetter, Base>(exec, &JSTestCustomNamedGetterTable, thisObject, propertyName, slot);
145
bool JSTestCustomNamedGetter::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
147
JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
148
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
149
if (canGetItemsForName(exec, static_cast<TestCustomNamedGetter*>(thisObject->impl()), propertyName)) {
151
slot.setCustom(thisObject, nameGetter);
152
descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
155
return getStaticValueDescriptor<JSTestCustomNamedGetter, Base>(exec, &JSTestCustomNamedGetterTable, thisObject, propertyName, descriptor);
158
bool JSTestCustomNamedGetter::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned index, PropertySlot& slot)
160
JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(cell);
161
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
162
PropertyName propertyName = Identifier::from(exec, index);
163
if (canGetItemsForName(exec, static_cast<TestCustomNamedGetter*>(thisObject->impl()), propertyName)) {
164
slot.setCustom(thisObject, thisObject->nameGetter);
167
return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
170
JSValue jsTestCustomNamedGetterConstructor(ExecState* exec, JSValue slotBase, PropertyName)
172
JSTestCustomNamedGetter* domObject = jsCast<JSTestCustomNamedGetter*>(asObject(slotBase));
173
return JSTestCustomNamedGetter::getConstructor(exec, domObject->globalObject());
176
JSValue JSTestCustomNamedGetter::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
178
return getDOMConstructor<JSTestCustomNamedGetterConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
181
EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunction(ExecState* exec)
183
JSValue thisValue = exec->hostThisValue();
184
if (!thisValue.inherits(&JSTestCustomNamedGetter::s_info))
185
return throwVMTypeError(exec);
186
JSTestCustomNamedGetter* castedThis = jsCast<JSTestCustomNamedGetter*>(asObject(thisValue));
187
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestCustomNamedGetter::s_info);
188
TestCustomNamedGetter* impl = static_cast<TestCustomNamedGetter*>(castedThis->impl());
189
if (exec->argumentCount() < 1)
190
return throwVMError(exec, createNotEnoughArgumentsError(exec));
191
const String& str(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
192
if (exec->hadException())
193
return JSValue::encode(jsUndefined());
194
impl->anotherFunction(str);
195
return JSValue::encode(jsUndefined());
198
static inline bool isObservable(JSTestCustomNamedGetter* jsTestCustomNamedGetter)
200
if (jsTestCustomNamedGetter->hasCustomProperties())
205
bool JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
207
JSTestCustomNamedGetter* jsTestCustomNamedGetter = jsCast<JSTestCustomNamedGetter*>(handle.get().asCell());
208
if (!isObservable(jsTestCustomNamedGetter))
210
UNUSED_PARAM(visitor);
214
void JSTestCustomNamedGetterOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
216
JSTestCustomNamedGetter* jsTestCustomNamedGetter = jsCast<JSTestCustomNamedGetter*>(handle.get().asCell());
217
DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
218
uncacheWrapper(world, jsTestCustomNamedGetter->impl(), jsTestCustomNamedGetter);
219
jsTestCustomNamedGetter->releaseImpl();
222
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestCustomNamedGetter* impl)
224
return wrap<JSTestCustomNamedGetter>(exec, globalObject, impl);
227
TestCustomNamedGetter* toTestCustomNamedGetter(JSC::JSValue value)
229
return value.inherits(&JSTestCustomNamedGetter::s_info) ? jsCast<JSTestCustomNamedGetter*>(asObject(value))->impl() : 0;