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 "JSTestObj.h"
24 #include "JSEventListener.h"
25 #include "JSTestObj.h"
28 #include "ScriptCallStack.h"
29 #include "SerializedScriptValue.h"
31 #include <runtime/Error.h>
32 #include <runtime/JSNumberCell.h>
33 #include <runtime/JSString.h>
34 #include <wtf/GetPtr.h>
40 ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
44 #define THUNK_GENERATOR(generator) , generator
46 #define THUNK_GENERATOR(generator)
49 static const HashTableValue JSTestObjTableValues[15] =
51 { "readOnlyIntAttr", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
52 { "readOnlyStringAttr", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
53 { "readOnlyTestObjAttr", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0 THUNK_GENERATOR(0) },
54 { "intAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjIntAttr), (intptr_t)setJSTestObjIntAttr THUNK_GENERATOR(0) },
55 { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr THUNK_GENERATOR(0) },
56 { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) },
57 { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
58 { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
59 { "attrWithException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithException), (intptr_t)setJSTestObjAttrWithException THUNK_GENERATOR(0) },
60 { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) },
61 { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) },
62 { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) },
63 { "scriptStringAttr", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
64 { "constructor", DontEnum|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
65 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
68 #undef THUNK_GENERATOR
69 static JSC_CONST_HASHTABLE HashTable JSTestObjTable =
70 #if ENABLE(PERFECT_HASH_SIZE)
71 { 127, JSTestObjTableValues, 0 };
73 { 34, 31, JSTestObjTableValues, 0 };
76 /* Hash table for constructor */
78 #define THUNK_GENERATOR(generator) , generator
80 #define THUNK_GENERATOR(generator)
83 static const HashTableValue JSTestObjConstructorTableValues[1] =
85 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
88 #undef THUNK_GENERATOR
89 static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable =
90 #if ENABLE(PERFECT_HASH_SIZE)
91 { 0, JSTestObjConstructorTableValues, 0 };
93 { 1, 0, JSTestObjConstructorTableValues, 0 };
96 class JSTestObjConstructor : public DOMConstructorObject {
98 JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
99 : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
101 putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), None);
103 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
104 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
105 virtual const ClassInfo* classInfo() const { return &s_info; }
106 static const ClassInfo s_info;
108 static PassRefPtr<Structure> createStructure(JSValue proto)
110 return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
114 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
117 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 };
119 bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
121 return getStaticValueSlot<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, slot);
124 bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
126 return getStaticValueDescriptor<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, descriptor);
129 /* Hash table for prototype */
131 #define THUNK_GENERATOR(generator) , generator
133 #define THUNK_GENERATOR(generator)
136 static const HashTableValue JSTestObjPrototypeTableValues[26] =
138 { "voidMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) },
139 { "voidMethodWithArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
140 { "intMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) },
141 { "intMethodWithArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
142 { "objMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t)0 THUNK_GENERATOR(0) },
143 { "objMethodWithArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
144 { "serializedValue", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1 THUNK_GENERATOR(0) },
145 { "methodWithException", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0 THUNK_GENERATOR(0) },
146 { "customMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0 THUNK_GENERATOR(0) },
147 { "customMethodWithArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
148 { "customArgsAndException", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1 THUNK_GENERATOR(0) },
149 { "addEventListener", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3 THUNK_GENERATOR(0) },
150 { "removeEventListener", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3 THUNK_GENERATOR(0) },
151 { "withDynamicFrame", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrame), (intptr_t)0 THUNK_GENERATOR(0) },
152 { "withDynamicFrameAndArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndArg), (intptr_t)1 THUNK_GENERATOR(0) },
153 { "withDynamicFrameAndOptionalArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) },
154 { "withDynamicFrameAndUserGesture", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture), (intptr_t)1 THUNK_GENERATOR(0) },
155 { "withDynamicFrameAndUserGestureASAD", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD), (intptr_t)2 THUNK_GENERATOR(0) },
156 { "withScriptStateVoid", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0 THUNK_GENERATOR(0) },
157 { "withScriptStateObj", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0 THUNK_GENERATOR(0) },
158 { "withScriptStateVoidException", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0 THUNK_GENERATOR(0) },
159 { "withScriptStateObjException", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0 THUNK_GENERATOR(0) },
160 { "methodWithOptionalArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) },
161 { "methodWithNonOptionalArgAndOptionalArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) },
162 { "methodWithNonOptionalArgAndTwoOptionalArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t)3 THUNK_GENERATOR(0) },
163 { 0, 0, 0, 0 THUNK_GENERATOR(0) }
166 #undef THUNK_GENERATOR
167 static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable =
168 #if ENABLE(PERFECT_HASH_SIZE)
169 { 8191, JSTestObjPrototypeTableValues, 0 };
171 { 67, 63, JSTestObjPrototypeTableValues, 0 };
174 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };
176 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
178 return getDOMPrototype<JSTestObj>(exec, globalObject);
181 bool JSTestObjPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
183 return getStaticFunctionSlot<JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, slot);
186 bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
188 return getStaticFunctionDescriptor<JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
191 const ClassInfo JSTestObj::s_info = { "TestObj", 0, &JSTestObjTable, 0 };
193 JSTestObj::JSTestObj(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
194 : DOMObjectWithGlobalPointer(structure, globalObject)
199 JSTestObj::~JSTestObj()
201 forgetDOMObject(this, impl());
204 JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
206 return new (exec) JSTestObjPrototype(JSTestObjPrototype::createStructure(globalObject->objectPrototype()));
209 bool JSTestObj::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
211 return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, slot);
214 bool JSTestObj::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
216 return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, descriptor);
219 JSValue jsTestObjReadOnlyIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
221 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
223 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
224 JSValue result = jsNumber(exec, imp->readOnlyIntAttr());
228 JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
230 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
232 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
233 JSValue result = jsString(exec, imp->readOnlyStringAttr());
237 JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
239 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
241 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
242 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->readOnlyTestObjAttr()));
246 JSValue jsTestObjIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
248 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
250 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
251 JSValue result = jsNumber(exec, imp->intAttr());
255 JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
257 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
259 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
260 JSValue result = jsNumber(exec, imp->longLongAttr());
264 JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
266 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
268 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
269 JSValue result = jsNumber(exec, imp->unsignedLongLongAttr());
273 JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
275 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
277 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
278 JSValue result = jsString(exec, imp->stringAttr());
282 JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
284 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
286 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
287 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->testObjAttr()));
291 JSValue jsTestObjAttrWithException(ExecState* exec, JSValue slotBase, const Identifier&)
293 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
295 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
296 JSValue result = jsNumber(exec, imp->attrWithException());
300 JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
302 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
304 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
305 JSValue result = jsNumber(exec, imp->attrWithSetterException());
309 JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
311 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
313 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
314 JSValue result = jsNumber(exec, imp->attrWithGetterException());
318 JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier&)
320 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
321 return castedThis->customAttr(exec);
324 JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
326 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
328 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
329 JSValue result = jsOwnedStringOrNull(exec, imp->scriptStringAttr());
333 JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
335 JSTestObj* domObject = static_cast<JSTestObj*>(asObject(slotBase));
336 return JSTestObj::getConstructor(exec, domObject->globalObject());
338 void JSTestObj::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
340 lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, this, slot);
343 void setJSTestObjIntAttr(ExecState* exec, JSObject* thisObject, JSValue value)
345 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
346 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
347 imp->setIntAttr(value.toInt32(exec));
350 void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
352 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
353 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
354 imp->setLongLongAttr(static_cast<long long>(value.toInteger(exec)));
357 void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
359 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
360 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
361 imp->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec)));
364 void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
366 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
367 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
368 imp->setStringAttr(ustringToString(value.toString(exec)));
371 void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
373 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
374 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
375 imp->setTestObjAttr(toTestObj(value));
378 void setJSTestObjAttrWithException(ExecState* exec, JSObject* thisObject, JSValue value)
380 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
381 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
382 imp->setAttrWithException(value.toInt32(exec));
385 void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
387 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
388 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
389 imp->setAttrWithSetterException(value.toInt32(exec));
392 void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
394 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
395 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
396 imp->setAttrWithGetterException(value.toInt32(exec));
399 void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value)
401 static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
404 JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
406 return getDOMConstructor<JSTestObjConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
409 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
412 if (!thisValue.inherits(&JSTestObj::s_info))
413 return throwError(exec, TypeError);
414 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
415 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
418 return jsUndefined();
421 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
424 if (!thisValue.inherits(&JSTestObj::s_info))
425 return throwError(exec, TypeError);
426 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
427 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
428 int intArg = args.at(0).toInt32(exec);
429 const String& strArg = ustringToString(args.at(1).toString(exec));
430 TestObj* objArg = toTestObj(args.at(2));
432 imp->voidMethodWithArgs(intArg, strArg, objArg);
433 return jsUndefined();
436 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
439 if (!thisValue.inherits(&JSTestObj::s_info))
440 return throwError(exec, TypeError);
441 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
442 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
445 JSC::JSValue result = jsNumber(exec, imp->intMethod());
449 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
452 if (!thisValue.inherits(&JSTestObj::s_info))
453 return throwError(exec, TypeError);
454 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
455 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
456 int intArg = args.at(0).toInt32(exec);
457 const String& strArg = ustringToString(args.at(1).toString(exec));
458 TestObj* objArg = toTestObj(args.at(2));
461 JSC::JSValue result = jsNumber(exec, imp->intMethodWithArgs(intArg, strArg, objArg));
465 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
468 if (!thisValue.inherits(&JSTestObj::s_info))
469 return throwError(exec, TypeError);
470 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
471 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
474 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethod()));
478 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
481 if (!thisValue.inherits(&JSTestObj::s_info))
482 return throwError(exec, TypeError);
483 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
484 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
485 int intArg = args.at(0).toInt32(exec);
486 const String& strArg = ustringToString(args.at(1).toString(exec));
487 TestObj* objArg = toTestObj(args.at(2));
490 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethodWithArgs(intArg, strArg, objArg)));
494 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
497 if (!thisValue.inherits(&JSTestObj::s_info))
498 return throwError(exec, TypeError);
499 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
500 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
501 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(exec, args.at(0));
503 imp->serializedValue(serializedArg);
504 return jsUndefined();
507 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
510 if (!thisValue.inherits(&JSTestObj::s_info))
511 return throwError(exec, TypeError);
512 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
513 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
514 ExceptionCode ec = 0;
516 imp->methodWithException(ec);
517 setDOMException(exec, ec);
518 return jsUndefined();
521 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
524 if (!thisValue.inherits(&JSTestObj::s_info))
525 return throwError(exec, TypeError);
526 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
527 return castedThis->customMethod(exec, args);
530 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
533 if (!thisValue.inherits(&JSTestObj::s_info))
534 return throwError(exec, TypeError);
535 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
536 return castedThis->customMethodWithArgs(exec, args);
539 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
542 if (!thisValue.inherits(&JSTestObj::s_info))
543 return throwError(exec, TypeError);
544 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
545 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
546 ExceptionCode ec = 0;
547 ScriptCallStack callStack(exec, args, 1);
548 log* intArg = tolog(args.at(0));
550 imp->customArgsAndException(intArg, &callStack, ec);
551 setDOMException(exec, ec);
552 return jsUndefined();
555 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
558 if (!thisValue.inherits(&JSTestObj::s_info))
559 return throwError(exec, TypeError);
560 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
561 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
562 JSValue listener = args.at(1);
563 if (!listener.isObject())
564 return jsUndefined();
565 imp->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), args.at(2).toBoolean(exec));
566 return jsUndefined();
569 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
572 if (!thisValue.inherits(&JSTestObj::s_info))
573 return throwError(exec, TypeError);
574 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
575 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
576 JSValue listener = args.at(1);
577 if (!listener.isObject())
578 return jsUndefined();
579 imp->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
580 return jsUndefined();
583 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
586 if (!thisValue.inherits(&JSTestObj::s_info))
587 return throwError(exec, TypeError);
588 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
589 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
590 Frame* dynamicFrame = toDynamicFrame(exec);
592 return jsUndefined();
594 imp->withDynamicFrame(dynamicFrame);
595 return jsUndefined();
598 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
601 if (!thisValue.inherits(&JSTestObj::s_info))
602 return throwError(exec, TypeError);
603 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
604 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
605 Frame* dynamicFrame = toDynamicFrame(exec);
607 return jsUndefined();
608 int intArg = args.at(1).toInt32(exec);
610 imp->withDynamicFrameAndArg(dynamicFrame, intArg);
611 return jsUndefined();
614 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
617 if (!thisValue.inherits(&JSTestObj::s_info))
618 return throwError(exec, TypeError);
619 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
620 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
621 Frame* dynamicFrame = toDynamicFrame(exec);
623 return jsUndefined();
624 int intArg = args.at(1).toInt32(exec);
626 int argsCount = args.size();
628 imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg);
629 return jsUndefined();
632 int optionalArg = args.at(2).toInt32(exec);
634 imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg, optionalArg);
635 return jsUndefined();
638 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
641 if (!thisValue.inherits(&JSTestObj::s_info))
642 return throwError(exec, TypeError);
643 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
644 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
645 Frame* dynamicFrame = toDynamicFrame(exec);
647 return jsUndefined();
648 int intArg = args.at(1).toInt32(exec);
650 imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, processingUserGesture(exec));
651 return jsUndefined();
654 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
657 if (!thisValue.inherits(&JSTestObj::s_info))
658 return throwError(exec, TypeError);
659 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
660 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
661 Frame* dynamicFrame = toDynamicFrame(exec);
663 return jsUndefined();
664 int intArg = args.at(1).toInt32(exec);
666 int argsCount = args.size();
668 imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg);
669 return jsUndefined();
672 int optionalArg = args.at(2).toInt32(exec);
674 imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, processingUserGesture(exec));
675 return jsUndefined();
678 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
681 if (!thisValue.inherits(&JSTestObj::s_info))
682 return throwError(exec, TypeError);
683 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
684 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
686 imp->withScriptStateVoid(exec);
687 return jsUndefined();
690 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
693 if (!thisValue.inherits(&JSTestObj::s_info))
694 return throwError(exec, TypeError);
695 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
696 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
699 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObj(exec)));
700 if (exec->hadException())
701 return jsUndefined();
705 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
708 if (!thisValue.inherits(&JSTestObj::s_info))
709 return throwError(exec, TypeError);
710 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
711 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
712 ExceptionCode ec = 0;
714 imp->withScriptStateVoidException(exec, ec);
715 setDOMException(exec, ec);
716 return jsUndefined();
719 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
722 if (!thisValue.inherits(&JSTestObj::s_info))
723 return throwError(exec, TypeError);
724 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
725 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
726 ExceptionCode ec = 0;
729 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObjException(exec, ec)));
730 setDOMException(exec, ec);
731 if (exec->hadException())
732 return jsUndefined();
736 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
739 if (!thisValue.inherits(&JSTestObj::s_info))
740 return throwError(exec, TypeError);
741 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
742 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
744 int argsCount = args.size();
746 imp->methodWithOptionalArg();
747 return jsUndefined();
750 int opt = args.at(0).toInt32(exec);
752 imp->methodWithOptionalArg(opt);
753 return jsUndefined();
756 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
759 if (!thisValue.inherits(&JSTestObj::s_info))
760 return throwError(exec, TypeError);
761 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
762 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
763 int nonOpt = args.at(0).toInt32(exec);
765 int argsCount = args.size();
767 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
768 return jsUndefined();
771 int opt = args.at(1).toInt32(exec);
773 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
774 return jsUndefined();
777 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
780 if (!thisValue.inherits(&JSTestObj::s_info))
781 return throwError(exec, TypeError);
782 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
783 TestObj* imp = static_cast<TestObj*>(castedThis->impl());
784 int nonOpt = args.at(0).toInt32(exec);
786 int argsCount = args.size();
788 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
789 return jsUndefined();
792 int opt1 = args.at(1).toInt32(exec);
794 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
795 return jsUndefined();
798 int opt2 = args.at(2).toInt32(exec);
800 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
801 return jsUndefined();
804 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object)
806 return getDOMObjectWrapper<JSTestObj>(exec, globalObject, object);
808 TestObj* toTestObj(JSC::JSValue value)
810 return value.inherits(&JSTestObj::s_info) ? static_cast<JSTestObj*>(asObject(value))->impl() : 0;