2010-07-20 Jessie Berlin <jberlin@apple.com>
[WebKit-https.git] / WebCore / bindings / scripts / test / JS / JSTestObj.cpp
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 "JSTestObj.h"
23
24 #include "HTMLNames.h"
25 #include "IDBBindingUtilities.h"
26 #include "IDBKey.h"
27 #include "JSEventListener.h"
28 #include "JSTestObj.h"
29 #include "JSlog.h"
30 #include "KURL.h"
31 #include "ScriptCallStack.h"
32 #include "SerializedScriptValue.h"
33 #include "TestObj.h"
34 #include <runtime/Error.h>
35 #include <runtime/JSNumberCell.h>
36 #include <runtime/JSString.h>
37 #include <wtf/GetPtr.h>
38
39 using namespace JSC;
40
41 namespace WebCore {
42
43 ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
44
45 /* Hash table */
46 #if ENABLE(JIT)
47 #define THUNK_GENERATOR(generator) , generator
48 #else
49 #define THUNK_GENERATOR(generator)
50 #endif
51
52 static const HashTableValue JSTestObjTableValues[32] =
53 {
54     { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
55     { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
56     { "readOnlyTestObjAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0 THUNK_GENERATOR(0) },
57     { "intAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjIntAttr), (intptr_t)setJSTestObjIntAttr THUNK_GENERATOR(0) },
58     { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr THUNK_GENERATOR(0) },
59     { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) },
60     { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
61     { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
62     { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
63     { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
64     { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) },
65     { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) },
66     { "reflectedNonEmptyURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedNonEmptyURLAttr), (intptr_t)setJSTestObjReflectedNonEmptyURLAttr THUNK_GENERATOR(0) },
67     { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
68     { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr THUNK_GENERATOR(0) },
69     { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr THUNK_GENERATOR(0) },
70     { "reflectedCustomURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t)setJSTestObjReflectedCustomURLAttr THUNK_GENERATOR(0) },
71     { "reflectedCustomNonEmptyURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomNonEmptyURLAttr), (intptr_t)setJSTestObjReflectedCustomNonEmptyURLAttr THUNK_GENERATOR(0) },
72     { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) },
73     { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) },
74     { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException THUNK_GENERATOR(0) },
75     { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException THUNK_GENERATOR(0) },
76     { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) },
77     { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
78 #if ENABLE(Condition1)
79     { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1 THUNK_GENERATOR(0) },
80 #endif
81 #if ENABLE(Condition1) && ENABLE(Condition2)
82     { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2 THUNK_GENERATOR(0) },
83 #endif
84 #if ENABLE(Condition1) || ENABLE(Condition2)
85     { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3 THUNK_GENERATOR(0) },
86 #endif
87     { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0 THUNK_GENERATOR(0) },
88     { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId THUNK_GENERATOR(0) },
89     { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0 THUNK_GENERATOR(0) },
90     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
91     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
92 };
93
94 #undef THUNK_GENERATOR
95 static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 68, 63, JSTestObjTableValues, 0 };
96 /* Hash table for constructor */
97 #if ENABLE(JIT)
98 #define THUNK_GENERATOR(generator) , generator
99 #else
100 #define THUNK_GENERATOR(generator)
101 #endif
102
103 static const HashTableValue JSTestObjConstructorTableValues[12] =
104 {
105     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
106     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
107     { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) },
108     { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) },
109     { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) },
110     { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) },
111     { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) },
112     { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) },
113     { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) },
114     { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) },
115     { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) },
116     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
117 };
118
119 #undef THUNK_GENERATOR
120 static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 33, 31, JSTestObjConstructorTableValues, 0 };
121
122 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums);
123 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums);
124 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
125 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums);
126 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums);
127 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums);
128 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums);
129 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums);
130 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums);
131 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums);
132 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums);
133
134 class JSTestObjConstructor : public DOMConstructorObject {
135 public:
136     JSTestObjConstructor(JSC::ExecState*, JSDOMGlobalObject*);
137
138     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
139     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
140     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
141     static const JSC::ClassInfo s_info;
142     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
143     {
144         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
145     }
146 protected:
147     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
148 };
149
150 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 };
151
152 JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
153     : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
154 {
155     putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
156 }
157
158 bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
159 {
160     return getStaticValueSlot<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, slot);
161 }
162
163 bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
164 {
165     return getStaticValueDescriptor<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, descriptor);
166 }
167
168 /* Hash table for prototype */
169 #if ENABLE(JIT)
170 #define THUNK_GENERATOR(generator) , generator
171 #else
172 #define THUNK_GENERATOR(generator)
173 #endif
174
175 static const HashTableValue JSTestObjPrototypeTableValues[42] =
176 {
177     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
178     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
179     { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) },
180     { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) },
181     { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) },
182     { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) },
183     { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) },
184     { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) },
185     { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) },
186     { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) },
187     { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) },
188     { "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) },
189     { "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
190     { "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) },
191     { "intMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
192     { "objMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t)0 THUNK_GENERATOR(0) },
193     { "objMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
194     { "methodThatRequiresAllArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgs), (intptr_t)2 THUNK_GENERATOR(0) },
195     { "methodThatRequiresAllArgsAndThrows", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t)2 THUNK_GENERATOR(0) },
196     { "serializedValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1 THUNK_GENERATOR(0) },
197     { "idbKey", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIdbKey), (intptr_t)1 THUNK_GENERATOR(0) },
198     { "methodWithException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0 THUNK_GENERATOR(0) },
199     { "customMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0 THUNK_GENERATOR(0) },
200     { "customMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
201     { "customArgsAndException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1 THUNK_GENERATOR(0) },
202     { "addEventListener", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3 THUNK_GENERATOR(0) },
203     { "removeEventListener", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3 THUNK_GENERATOR(0) },
204     { "withDynamicFrame", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrame), (intptr_t)0 THUNK_GENERATOR(0) },
205     { "withDynamicFrameAndArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndArg), (intptr_t)1 THUNK_GENERATOR(0) },
206     { "withDynamicFrameAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) },
207     { "withDynamicFrameAndUserGesture", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture), (intptr_t)1 THUNK_GENERATOR(0) },
208     { "withDynamicFrameAndUserGestureASAD", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD), (intptr_t)2 THUNK_GENERATOR(0) },
209     { "withScriptStateVoid", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0 THUNK_GENERATOR(0) },
210     { "withScriptStateObj", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0 THUNK_GENERATOR(0) },
211     { "withScriptStateVoidException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0 THUNK_GENERATOR(0) },
212     { "withScriptStateObjException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0 THUNK_GENERATOR(0) },
213     { "withScriptExecutionContext", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t)0 THUNK_GENERATOR(0) },
214     { "methodWithOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) },
215     { "methodWithNonOptionalArgAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) },
216     { "methodWithNonOptionalArgAndTwoOptionalArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t)3 THUNK_GENERATOR(0) },
217     { "overloadedMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2 THUNK_GENERATOR(0) },
218     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
219 };
220
221 #undef THUNK_GENERATOR
222 static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 134, 127, JSTestObjPrototypeTableValues, 0 };
223 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };
224
225 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
226 {
227     return getDOMPrototype<JSTestObj>(exec, globalObject);
228 }
229
230 bool JSTestObjPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
231 {
232     return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, slot);
233 }
234
235 bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
236 {
237     return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
238 }
239
240 const ClassInfo JSTestObj::s_info = { "TestObj", 0, &JSTestObjTable, 0 };
241
242 JSTestObj::JSTestObj(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
243     : DOMObjectWithGlobalPointer(structure, globalObject)
244     , m_impl(impl)
245 {
246 }
247
248 JSTestObj::~JSTestObj()
249 {
250     forgetDOMObject(this, impl());
251 }
252
253 JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
254 {
255     return new (exec) JSTestObjPrototype(globalObject, JSTestObjPrototype::createStructure(globalObject->objectPrototype()));
256 }
257
258 bool JSTestObj::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
259 {
260     return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, slot);
261 }
262
263 bool JSTestObj::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
264 {
265     return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, descriptor);
266 }
267
268 JSValue jsTestObjReadOnlyIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
269 {
270     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
271     UNUSED_PARAM(exec);
272     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
273     JSValue result = jsNumber(exec, imp->readOnlyIntAttr());
274     return result;
275 }
276
277 JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
278 {
279     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
280     UNUSED_PARAM(exec);
281     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
282     JSValue result = jsString(exec, imp->readOnlyStringAttr());
283     return result;
284 }
285
286 JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
287 {
288     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
289     UNUSED_PARAM(exec);
290     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
291     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->readOnlyTestObjAttr()));
292     return result;
293 }
294
295 JSValue jsTestObjIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
296 {
297     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
298     UNUSED_PARAM(exec);
299     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
300     JSValue result = jsNumber(exec, imp->intAttr());
301     return result;
302 }
303
304 JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
305 {
306     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
307     UNUSED_PARAM(exec);
308     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
309     JSValue result = jsNumber(exec, imp->longLongAttr());
310     return result;
311 }
312
313 JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
314 {
315     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
316     UNUSED_PARAM(exec);
317     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
318     JSValue result = jsNumber(exec, imp->unsignedLongLongAttr());
319     return result;
320 }
321
322 JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
323 {
324     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
325     UNUSED_PARAM(exec);
326     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
327     JSValue result = jsString(exec, imp->stringAttr());
328     return result;
329 }
330
331 JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
332 {
333     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
334     UNUSED_PARAM(exec);
335     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
336     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->testObjAttr()));
337     return result;
338 }
339
340 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
341 {
342     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
343     UNUSED_PARAM(exec);
344     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
345     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
346     return result;
347 }
348
349 JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
350 {
351     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
352     UNUSED_PARAM(exec);
353     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
354     JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
355     return result;
356 }
357
358 JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
359 {
360     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
361     UNUSED_PARAM(exec);
362     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
363     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
364     return result;
365 }
366
367 JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
368 {
369     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
370     UNUSED_PARAM(exec);
371     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
372     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
373     return result;
374 }
375
376 JSValue jsTestObjReflectedNonEmptyURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
377 {
378     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
379     UNUSED_PARAM(exec);
380     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
381     JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr));
382     return result;
383 }
384
385 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
386 {
387     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
388     UNUSED_PARAM(exec);
389     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
390     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
391     return result;
392 }
393
394 JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
395 {
396     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
397     UNUSED_PARAM(exec);
398     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
399     JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
400     return result;
401 }
402
403 JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
404 {
405     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
406     UNUSED_PARAM(exec);
407     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
408     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
409     return result;
410 }
411
412 JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
413 {
414     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
415     UNUSED_PARAM(exec);
416     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
417     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
418     return result;
419 }
420
421 JSValue jsTestObjReflectedCustomNonEmptyURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
422 {
423     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
424     UNUSED_PARAM(exec);
425     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
426     JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr));
427     return result;
428 }
429
430 JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
431 {
432     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
433     ExceptionCode ec = 0;
434     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
435     JSC::JSValue result = jsNumber(exec, imp->attrWithGetterException(ec));
436     setDOMException(exec, ec);
437     return result;
438 }
439
440 JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
441 {
442     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
443     UNUSED_PARAM(exec);
444     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
445     JSValue result = jsNumber(exec, imp->attrWithSetterException());
446     return result;
447 }
448
449 JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
450 {
451     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
452     ExceptionCode ec = 0;
453     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
454     JSC::JSValue result = jsString(exec, imp->stringAttrWithGetterException(ec));
455     setDOMException(exec, ec);
456     return result;
457 }
458
459 JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
460 {
461     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
462     UNUSED_PARAM(exec);
463     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
464     JSValue result = jsString(exec, imp->stringAttrWithSetterException());
465     return result;
466 }
467
468 JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier&)
469 {
470     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
471     return castedThis->customAttr(exec);
472 }
473
474 JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
475 {
476     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
477     UNUSED_PARAM(exec);
478     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
479     JSValue result = jsOwnedStringOrNull(exec, imp->scriptStringAttr());
480     return result;
481 }
482
483 #if ENABLE(Condition1)
484 JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
485 {
486     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
487     UNUSED_PARAM(exec);
488     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
489     JSValue result = jsNumber(exec, imp->conditionalAttr1());
490     return result;
491 }
492 #endif
493
494 #if ENABLE(Condition1) && ENABLE(Condition2)
495 JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&)
496 {
497     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
498     UNUSED_PARAM(exec);
499     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
500     JSValue result = jsNumber(exec, imp->conditionalAttr2());
501     return result;
502 }
503 #endif
504
505 #if ENABLE(Condition1) || ENABLE(Condition2)
506 JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&)
507 {
508     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
509     UNUSED_PARAM(exec);
510     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
511     JSValue result = jsNumber(exec, imp->conditionalAttr3());
512     return result;
513 }
514 #endif
515
516 JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
517 {
518     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
519     UNUSED_PARAM(exec);
520     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
521     JSValue result = jsNumber(exec, imp->description());
522     return result;
523 }
524
525 JSValue jsTestObjId(ExecState* exec, JSValue slotBase, const Identifier&)
526 {
527     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
528     UNUSED_PARAM(exec);
529     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
530     JSValue result = jsNumber(exec, imp->id());
531     return result;
532 }
533
534 JSValue jsTestObjHash(ExecState* exec, JSValue slotBase, const Identifier&)
535 {
536     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
537     UNUSED_PARAM(exec);
538     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
539     JSValue result = jsString(exec, imp->hash());
540     return result;
541 }
542
543 JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
544 {
545     JSTestObj* domObject = static_cast<JSTestObj*>(asObject(slotBase));
546     return JSTestObj::getConstructor(exec, domObject->globalObject());
547 }
548 void JSTestObj::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
549 {
550     lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, this, slot);
551 }
552
553 void setJSTestObjIntAttr(ExecState* exec, JSObject* thisObject, JSValue value)
554 {
555     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
556     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
557     imp->setIntAttr(value.toInt32(exec));
558 }
559
560 void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
561 {
562     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
563     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
564     imp->setLongLongAttr(static_cast<long long>(value.toInteger(exec)));
565 }
566
567 void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
568 {
569     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
570     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
571     imp->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec)));
572 }
573
574 void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
575 {
576     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
577     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
578     imp->setStringAttr(ustringToString(value.toString(exec)));
579 }
580
581 void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
582 {
583     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
584     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
585     imp->setTestObjAttr(toTestObj(value));
586 }
587
588 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
589 {
590     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
591     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
592     imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
593 }
594
595 void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
596 {
597     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
598     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
599     imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec));
600 }
601
602 void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
603 {
604     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
605     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
606     imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
607 }
608
609 void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
610 {
611     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
612     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
613     imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
614 }
615
616 void setJSTestObjReflectedNonEmptyURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
617 {
618     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
619     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
620     imp->setAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr, valueToStringWithNullCheck(exec, value));
621 }
622
623 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
624 {
625     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
626     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
627     imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
628 }
629
630 void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
631 {
632     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
633     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
634     imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec));
635 }
636
637 void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
638 {
639     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
640     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
641     imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
642 }
643
644 void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
645 {
646     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
647     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
648     imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
649 }
650
651 void setJSTestObjReflectedCustomNonEmptyURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
652 {
653     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
654     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
655     imp->setAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr, valueToStringWithNullCheck(exec, value));
656 }
657
658 void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
659 {
660     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
661     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
662     ExceptionCode ec = 0;
663     imp->setAttrWithGetterException(value.toInt32(exec), ec);
664     setDOMException(exec, ec);
665 }
666
667 void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
668 {
669     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
670     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
671     ExceptionCode ec = 0;
672     imp->setAttrWithSetterException(value.toInt32(exec), ec);
673     setDOMException(exec, ec);
674 }
675
676 void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
677 {
678     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
679     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
680     ExceptionCode ec = 0;
681     imp->setStringAttrWithGetterException(ustringToString(value.toString(exec)), ec);
682     setDOMException(exec, ec);
683 }
684
685 void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
686 {
687     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
688     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
689     ExceptionCode ec = 0;
690     imp->setStringAttrWithSetterException(ustringToString(value.toString(exec)), ec);
691     setDOMException(exec, ec);
692 }
693
694 void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value)
695 {
696     static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
697 }
698
699 #if ENABLE(Condition1)
700 void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
701 {
702     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
703     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
704     imp->setConditionalAttr1(value.toInt32(exec));
705 }
706 #endif
707
708 #if ENABLE(Condition1) && ENABLE(Condition2)
709 void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value)
710 {
711     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
712     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
713     imp->setConditionalAttr2(value.toInt32(exec));
714 }
715 #endif
716
717 #if ENABLE(Condition1) || ENABLE(Condition2)
718 void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value)
719 {
720     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
721     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
722     imp->setConditionalAttr3(value.toInt32(exec));
723 }
724 #endif
725
726 void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
727 {
728     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
729     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
730     imp->setId(value.toInt32(exec));
731 }
732
733 JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
734 {
735     return getDOMConstructor<JSTestObjConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
736 }
737
738 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec)
739 {
740     JSValue thisValue = exec->hostThisValue();
741     if (!thisValue.inherits(&JSTestObj::s_info))
742         return throwVMTypeError(exec);
743     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
744     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
745
746     imp->voidMethod();
747     return JSValue::encode(jsUndefined());
748 }
749
750 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec)
751 {
752     JSValue thisValue = exec->hostThisValue();
753     if (!thisValue.inherits(&JSTestObj::s_info))
754         return throwVMTypeError(exec);
755     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
756     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
757     int intArg = exec->argument(0).toInt32(exec);
758     const String& strArg = ustringToString(exec->argument(1).toString(exec));
759     TestObj* objArg = toTestObj(exec->argument(2));
760
761     imp->voidMethodWithArgs(intArg, strArg, objArg);
762     return JSValue::encode(jsUndefined());
763 }
764
765 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec)
766 {
767     JSValue thisValue = exec->hostThisValue();
768     if (!thisValue.inherits(&JSTestObj::s_info))
769         return throwVMTypeError(exec);
770     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
771     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
772
773
774     JSC::JSValue result = jsNumber(exec, imp->intMethod());
775     return JSValue::encode(result);
776 }
777
778 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecState* exec)
779 {
780     JSValue thisValue = exec->hostThisValue();
781     if (!thisValue.inherits(&JSTestObj::s_info))
782         return throwVMTypeError(exec);
783     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
784     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
785     int intArg = exec->argument(0).toInt32(exec);
786     const String& strArg = ustringToString(exec->argument(1).toString(exec));
787     TestObj* objArg = toTestObj(exec->argument(2));
788
789
790     JSC::JSValue result = jsNumber(exec, imp->intMethodWithArgs(intArg, strArg, objArg));
791     return JSValue::encode(result);
792 }
793
794 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec)
795 {
796     JSValue thisValue = exec->hostThisValue();
797     if (!thisValue.inherits(&JSTestObj::s_info))
798         return throwVMTypeError(exec);
799     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
800     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
801
802
803     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethod()));
804     return JSValue::encode(result);
805 }
806
807 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec)
808 {
809     JSValue thisValue = exec->hostThisValue();
810     if (!thisValue.inherits(&JSTestObj::s_info))
811         return throwVMTypeError(exec);
812     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
813     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
814     int intArg = exec->argument(0).toInt32(exec);
815     const String& strArg = ustringToString(exec->argument(1).toString(exec));
816     TestObj* objArg = toTestObj(exec->argument(2));
817
818
819     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethodWithArgs(intArg, strArg, objArg)));
820     return JSValue::encode(result);
821 }
822
823 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgs(ExecState* exec)
824 {
825     JSValue thisValue = exec->hostThisValue();
826     if (!thisValue.inherits(&JSTestObj::s_info))
827         return throwVMTypeError(exec);
828     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
829     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
830     if (exec->argumentCount() < 2)
831         return JSValue::encode(jsUndefined());
832     const String& strArg = ustringToString(exec->argument(0).toString(exec));
833     TestObj* objArg = toTestObj(exec->argument(1));
834
835
836     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgs(strArg, objArg)));
837     return JSValue::encode(result);
838 }
839
840 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec)
841 {
842     JSValue thisValue = exec->hostThisValue();
843     if (!thisValue.inherits(&JSTestObj::s_info))
844         return throwVMTypeError(exec);
845     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
846     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
847     if (exec->argumentCount() < 2)
848         return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
849     ExceptionCode ec = 0;
850     const String& strArg = ustringToString(exec->argument(0).toString(exec));
851     TestObj* objArg = toTestObj(exec->argument(1));
852
853
854     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
855     setDOMException(exec, ec);
856     return JSValue::encode(result);
857 }
858
859 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec)
860 {
861     JSValue thisValue = exec->hostThisValue();
862     if (!thisValue.inherits(&JSTestObj::s_info))
863         return throwVMTypeError(exec);
864     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
865     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
866     RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(exec, exec->argument(0));
867
868     imp->serializedValue(serializedArg);
869     return JSValue::encode(jsUndefined());
870 }
871
872 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec)
873 {
874     JSValue thisValue = exec->hostThisValue();
875     if (!thisValue.inherits(&JSTestObj::s_info))
876         return throwVMTypeError(exec);
877     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
878     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
879     RefPtr<IDBKey> key = createIDBKeyFromValue(exec, exec->argument(0));
880
881     imp->idbKey(key);
882     return JSValue::encode(jsUndefined());
883 }
884
885 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec)
886 {
887     JSValue thisValue = exec->hostThisValue();
888     if (!thisValue.inherits(&JSTestObj::s_info))
889         return throwVMTypeError(exec);
890     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
891     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
892     ExceptionCode ec = 0;
893
894     imp->methodWithException(ec);
895     setDOMException(exec, ec);
896     return JSValue::encode(jsUndefined());
897 }
898
899 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec)
900 {
901     JSValue thisValue = exec->hostThisValue();
902     if (!thisValue.inherits(&JSTestObj::s_info))
903         return throwVMTypeError(exec);
904     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
905     return JSValue::encode(castedThis->customMethod(exec));
906 }
907
908 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec)
909 {
910     JSValue thisValue = exec->hostThisValue();
911     if (!thisValue.inherits(&JSTestObj::s_info))
912         return throwVMTypeError(exec);
913     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
914     return JSValue::encode(castedThis->customMethodWithArgs(exec));
915 }
916
917 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(ExecState* exec)
918 {
919     JSValue thisValue = exec->hostThisValue();
920     if (!thisValue.inherits(&JSTestObj::s_info))
921         return throwVMTypeError(exec);
922     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
923     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
924     ExceptionCode ec = 0;
925     ScriptCallStack callStack(exec, 1);
926     log* intArg = tolog(exec->argument(0));
927
928     imp->customArgsAndException(intArg, &callStack, ec);
929     setDOMException(exec, ec);
930     return JSValue::encode(jsUndefined());
931 }
932
933 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec)
934 {
935     JSValue thisValue = exec->hostThisValue();
936     if (!thisValue.inherits(&JSTestObj::s_info))
937         return throwVMTypeError(exec);
938     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
939     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
940     JSValue listener = exec->argument(1);
941     if (!listener.isObject())
942         return JSValue::encode(jsUndefined());
943     imp->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
944     return JSValue::encode(jsUndefined());
945 }
946
947 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec)
948 {
949     JSValue thisValue = exec->hostThisValue();
950     if (!thisValue.inherits(&JSTestObj::s_info))
951         return throwVMTypeError(exec);
952     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
953     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
954     JSValue listener = exec->argument(1);
955     if (!listener.isObject())
956         return JSValue::encode(jsUndefined());
957     imp->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
958     return JSValue::encode(jsUndefined());
959 }
960
961 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(ExecState* exec)
962 {
963     JSValue thisValue = exec->hostThisValue();
964     if (!thisValue.inherits(&JSTestObj::s_info))
965         return throwVMTypeError(exec);
966     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
967     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
968     Frame* dynamicFrame = toDynamicFrame(exec);
969     if (!dynamicFrame)
970         return JSValue::encode(jsUndefined());
971
972     imp->withDynamicFrame(dynamicFrame);
973     return JSValue::encode(jsUndefined());
974 }
975
976 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(ExecState* exec)
977 {
978     JSValue thisValue = exec->hostThisValue();
979     if (!thisValue.inherits(&JSTestObj::s_info))
980         return throwVMTypeError(exec);
981     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
982     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
983     Frame* dynamicFrame = toDynamicFrame(exec);
984     if (!dynamicFrame)
985         return JSValue::encode(jsUndefined());
986     int intArg = exec->argument(0).toInt32(exec);
987
988     imp->withDynamicFrameAndArg(dynamicFrame, intArg);
989     return JSValue::encode(jsUndefined());
990 }
991
992 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(ExecState* exec)
993 {
994     JSValue thisValue = exec->hostThisValue();
995     if (!thisValue.inherits(&JSTestObj::s_info))
996         return throwVMTypeError(exec);
997     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
998     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
999     Frame* dynamicFrame = toDynamicFrame(exec);
1000     if (!dynamicFrame)
1001         return JSValue::encode(jsUndefined());
1002     int intArg = exec->argument(0).toInt32(exec);
1003
1004     int argsCount = exec->argumentCount();
1005     if (argsCount < 2) {
1006         imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg);
1007         return JSValue::encode(jsUndefined());
1008     }
1009
1010     int optionalArg = exec->argument(1).toInt32(exec);
1011
1012     imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg, optionalArg);
1013     return JSValue::encode(jsUndefined());
1014 }
1015
1016 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(ExecState* exec)
1017 {
1018     JSValue thisValue = exec->hostThisValue();
1019     if (!thisValue.inherits(&JSTestObj::s_info))
1020         return throwVMTypeError(exec);
1021     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1022     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1023     Frame* dynamicFrame = toDynamicFrame(exec);
1024     if (!dynamicFrame)
1025         return JSValue::encode(jsUndefined());
1026     int intArg = exec->argument(0).toInt32(exec);
1027
1028     imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, processingUserGesture(exec));
1029     return JSValue::encode(jsUndefined());
1030 }
1031
1032 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(ExecState* exec)
1033 {
1034     JSValue thisValue = exec->hostThisValue();
1035     if (!thisValue.inherits(&JSTestObj::s_info))
1036         return throwVMTypeError(exec);
1037     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1038     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1039     Frame* dynamicFrame = toDynamicFrame(exec);
1040     if (!dynamicFrame)
1041         return JSValue::encode(jsUndefined());
1042     int intArg = exec->argument(0).toInt32(exec);
1043
1044     int argsCount = exec->argumentCount();
1045     if (argsCount < 2) {
1046         imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg);
1047         return JSValue::encode(jsUndefined());
1048     }
1049
1050     int optionalArg = exec->argument(1).toInt32(exec);
1051
1052     imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, processingUserGesture(exec));
1053     return JSValue::encode(jsUndefined());
1054 }
1055
1056 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec)
1057 {
1058     JSValue thisValue = exec->hostThisValue();
1059     if (!thisValue.inherits(&JSTestObj::s_info))
1060         return throwVMTypeError(exec);
1061     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1062     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1063
1064     imp->withScriptStateVoid(exec);
1065     return JSValue::encode(jsUndefined());
1066 }
1067
1068 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec)
1069 {
1070     JSValue thisValue = exec->hostThisValue();
1071     if (!thisValue.inherits(&JSTestObj::s_info))
1072         return throwVMTypeError(exec);
1073     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1074     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1075
1076
1077     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObj(exec)));
1078     if (exec->hadException())
1079         return JSValue::encode(jsUndefined());
1080     return JSValue::encode(result);
1081 }
1082
1083 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec)
1084 {
1085     JSValue thisValue = exec->hostThisValue();
1086     if (!thisValue.inherits(&JSTestObj::s_info))
1087         return throwVMTypeError(exec);
1088     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1089     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1090     ExceptionCode ec = 0;
1091
1092     imp->withScriptStateVoidException(exec, ec);
1093     setDOMException(exec, ec);
1094     return JSValue::encode(jsUndefined());
1095 }
1096
1097 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec)
1098 {
1099     JSValue thisValue = exec->hostThisValue();
1100     if (!thisValue.inherits(&JSTestObj::s_info))
1101         return throwVMTypeError(exec);
1102     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1103     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1104     ExceptionCode ec = 0;
1105
1106
1107     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObjException(exec, ec)));
1108     setDOMException(exec, ec);
1109     if (exec->hadException())
1110         return JSValue::encode(jsUndefined());
1111     return JSValue::encode(result);
1112 }
1113
1114 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
1115 {
1116     JSValue thisValue = exec->hostThisValue();
1117     if (!thisValue.inherits(&JSTestObj::s_info))
1118         return throwVMTypeError(exec);
1119     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1120     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1121     ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1122     if (!scriptContext)
1123         return JSValue::encode(jsUndefined());
1124
1125     imp->withScriptExecutionContext(scriptContext);
1126     return JSValue::encode(jsUndefined());
1127 }
1128
1129 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec)
1130 {
1131     JSValue thisValue = exec->hostThisValue();
1132     if (!thisValue.inherits(&JSTestObj::s_info))
1133         return throwVMTypeError(exec);
1134     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1135     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1136
1137     int argsCount = exec->argumentCount();
1138     if (argsCount < 1) {
1139         imp->methodWithOptionalArg();
1140         return JSValue::encode(jsUndefined());
1141     }
1142
1143     int opt = exec->argument(0).toInt32(exec);
1144
1145     imp->methodWithOptionalArg(opt);
1146     return JSValue::encode(jsUndefined());
1147 }
1148
1149 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec)
1150 {
1151     JSValue thisValue = exec->hostThisValue();
1152     if (!thisValue.inherits(&JSTestObj::s_info))
1153         return throwVMTypeError(exec);
1154     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1155     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1156     int nonOpt = exec->argument(0).toInt32(exec);
1157
1158     int argsCount = exec->argumentCount();
1159     if (argsCount < 2) {
1160         imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
1161         return JSValue::encode(jsUndefined());
1162     }
1163
1164     int opt = exec->argument(1).toInt32(exec);
1165
1166     imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
1167     return JSValue::encode(jsUndefined());
1168 }
1169
1170 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec)
1171 {
1172     JSValue thisValue = exec->hostThisValue();
1173     if (!thisValue.inherits(&JSTestObj::s_info))
1174         return throwVMTypeError(exec);
1175     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1176     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1177     int nonOpt = exec->argument(0).toInt32(exec);
1178
1179     int argsCount = exec->argumentCount();
1180     if (argsCount < 2) {
1181         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
1182         return JSValue::encode(jsUndefined());
1183     }
1184
1185     int opt1 = exec->argument(1).toInt32(exec);
1186     int opt2 = exec->argument(2).toInt32(exec);
1187
1188     imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
1189     return JSValue::encode(jsUndefined());
1190 }
1191
1192 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
1193 {
1194     JSValue thisValue = exec->hostThisValue();
1195     if (!thisValue.inherits(&JSTestObj::s_info))
1196         return throwVMTypeError(exec);
1197     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1198     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1199     TestObj* objArg = toTestObj(exec->argument(0));
1200     const String& strArg = ustringToString(exec->argument(1).toString(exec));
1201
1202     imp->overloadedMethod(objArg, strArg);
1203     return JSValue::encode(jsUndefined());
1204 }
1205
1206 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
1207 {
1208     JSValue thisValue = exec->hostThisValue();
1209     if (!thisValue.inherits(&JSTestObj::s_info))
1210         return throwVMTypeError(exec);
1211     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1212     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1213     TestObj* objArg = toTestObj(exec->argument(0));
1214
1215     int argsCount = exec->argumentCount();
1216     if (argsCount < 2) {
1217         imp->overloadedMethod(objArg);
1218         return JSValue::encode(jsUndefined());
1219     }
1220
1221     int intArg = exec->argument(1).toInt32(exec);
1222
1223     imp->overloadedMethod(objArg, intArg);
1224     return JSValue::encode(jsUndefined());
1225 }
1226
1227 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
1228 {
1229     JSValue thisValue = exec->hostThisValue();
1230     if (!thisValue.inherits(&JSTestObj::s_info))
1231         return throwVMTypeError(exec);
1232     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1233     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1234     const String& strArg = ustringToString(exec->argument(0).toString(exec));
1235
1236     imp->overloadedMethod(strArg);
1237     return JSValue::encode(jsUndefined());
1238 }
1239
1240 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
1241 {
1242     JSValue thisValue = exec->hostThisValue();
1243     if (!thisValue.inherits(&JSTestObj::s_info))
1244         return throwVMTypeError(exec);
1245     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1246     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1247     int intArg = exec->argument(0).toInt32(exec);
1248
1249     imp->overloadedMethod(intArg);
1250     return JSValue::encode(jsUndefined());
1251 }
1252
1253 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
1254 {
1255     if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
1256         return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
1257     if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))
1258         return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
1259     if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject())))
1260         return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
1261     if (exec->argumentCount() == 1)
1262         return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
1263     return throwVMTypeError(exec);
1264 }
1265
1266 // Constant getters
1267
1268 JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&)
1269 {
1270     return jsNumber(exec, static_cast<int>(0));
1271 }
1272
1273 JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, const Identifier&)
1274 {
1275     return jsNumber(exec, static_cast<int>(1));
1276 }
1277
1278 JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, const Identifier&)
1279 {
1280     return jsNumber(exec, static_cast<int>(2));
1281 }
1282
1283 JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, const Identifier&)
1284 {
1285     return jsNumber(exec, static_cast<int>(4));
1286 }
1287
1288 JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&)
1289 {
1290     return jsNumber(exec, static_cast<int>(8));
1291 }
1292
1293 JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&)
1294 {
1295     return jsNumber(exec, static_cast<int>(-1));
1296 }
1297
1298 JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&)
1299 {
1300     return jsStringOrNull(exec, String("my constant string"));
1301 }
1302
1303 JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&)
1304 {
1305     return jsNumber(exec, static_cast<int>(0xffffffff));
1306 }
1307
1308 JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&)
1309 {
1310     return jsNumber(exec, static_cast<int>(0x01));
1311 }
1312
1313 JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&)
1314 {
1315     return jsNumber(exec, static_cast<int>(0X20));
1316 }
1317
1318 JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&)
1319 {
1320     return jsNumber(exec, static_cast<int>(0x1abc));
1321 }
1322
1323 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object)
1324 {
1325     return getDOMObjectWrapper<JSTestObj>(exec, globalObject, object);
1326 }
1327 TestObj* toTestObj(JSC::JSValue value)
1328 {
1329     return value.inherits(&JSTestObj::s_info) ? static_cast<JSTestObj*>(asObject(value))->impl() : 0;
1330 }
1331
1332 }