Add custom vtable struct to ClassInfo struct
[WebKit-https.git] / Source / 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 "ExceptionCode.h"
25 #include "HTMLNames.h"
26 #include "IDBBindingUtilities.h"
27 #include "IDBKey.h"
28 #include "JSDOMBinding.h"
29 #include "JSEventListener.h"
30 #include "JSOptionsObject.h"
31 #include "JSTestCallback.h"
32 #include "JSTestObj.h"
33 #include "JSlog.h"
34 #include "KURL.h"
35 #include "ScriptArguments.h"
36 #include "ScriptCallStack.h"
37 #include "ScriptCallStackFactory.h"
38 #include "ScriptController.h"
39 #include "SerializedScriptValue.h"
40 #include "TestObj.h"
41 #include <runtime/Error.h>
42 #include <runtime/JSString.h>
43 #include <wtf/GetPtr.h>
44
45 #if ENABLE(Condition1)
46 #include "JSTestObjectA.h"
47 #endif
48
49 #if ENABLE(Condition1) && ENABLE(Condition2)
50 #include "JSTestObjectB.h"
51 #endif
52
53 #if ENABLE(Condition1) || ENABLE(Condition2)
54 #include "JSTestObjectC.h"
55 #endif
56
57 using namespace JSC;
58
59 namespace WebCore {
60
61 ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
62
63 /* Hash table */
64 #if ENABLE(JIT)
65 #define THUNK_GENERATOR(generator) , generator
66 #else
67 #define THUNK_GENERATOR(generator)
68 #endif
69 #if ENABLE(DFG_JIT)
70 #define INTRINSIC(intrinsic) , intrinsic
71 #else
72 #define INTRINSIC(intrinsic)
73 #endif
74
75 static const HashTableValue JSTestObjTableValues[] =
76 {
77     { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
78     { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
79     { "readOnlyTestObjAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
80     { "shortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjShortAttr), (intptr_t)setJSTestObjShortAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81     { "unsignedShortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedShortAttr), (intptr_t)setJSTestObjUnsignedShortAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82     { "intAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjIntAttr), (intptr_t)setJSTestObjIntAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83     { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
84     { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
85     { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
86     { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
87     { "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
88     { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
89     { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
90     { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
91     { "reflectedUnsignedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedUnsignedIntegralAttr), (intptr_t)setJSTestObjReflectedUnsignedIntegralAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
92     { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
93     { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
94     { "reflectedNonEmptyURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedNonEmptyURLAttr), (intptr_t)setJSTestObjReflectedNonEmptyURLAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
95     { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
96     { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
97     { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
98     { "reflectedCustomURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t)setJSTestObjReflectedCustomURLAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
99     { "reflectedCustomNonEmptyURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomNonEmptyURLAttr), (intptr_t)setJSTestObjReflectedCustomNonEmptyURLAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
100     { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
101     { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
102     { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
103     { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
104     { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
105     { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
106 #if ENABLE(Condition1)
107     { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
108 #endif
109 #if ENABLE(Condition1) && ENABLE(Condition2)
110     { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
111 #endif
112 #if ENABLE(Condition1) || ENABLE(Condition2)
113     { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
114 #endif
115 #if ENABLE(Condition1)
116     { "conditionalAttr4", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t)setJSTestObjConditionalAttr4Constructor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
117 #endif
118 #if ENABLE(Condition1) && ENABLE(Condition2)
119     { "conditionalAttr5", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr5Constructor), (intptr_t)setJSTestObjConditionalAttr5Constructor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
120 #endif
121 #if ENABLE(Condition1) || ENABLE(Condition2)
122     { "conditionalAttr6", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr6Constructor), (intptr_t)setJSTestObjConditionalAttr6Constructor THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
123 #endif
124     { "cachedAttribute1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
125     { "cachedAttribute2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
126     { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
127     { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
128     { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
129     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
130     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
131 };
132
133 #undef THUNK_GENERATOR
134 static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 135, 127, JSTestObjTableValues, 0 };
135 /* Hash table for constructor */
136 #if ENABLE(JIT)
137 #define THUNK_GENERATOR(generator) , generator
138 #else
139 #define THUNK_GENERATOR(generator)
140 #endif
141 #if ENABLE(DFG_JIT)
142 #define INTRINSIC(intrinsic) , intrinsic
143 #else
144 #define INTRINSIC(intrinsic)
145 #endif
146
147 static const HashTableValue JSTestObjConstructorTableValues[] =
148 {
149     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
150     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
151     { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
152     { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
153     { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
154     { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
155     { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
156     { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
157     { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
158     { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
159     { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
160     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
161 };
162
163 #undef THUNK_GENERATOR
164 static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 33, 31, JSTestObjConstructorTableValues, 0 };
165
166 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums);
167 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums);
168 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums);
169 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums);
170 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums);
171 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums);
172 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums);
173 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums);
174 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums);
175 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums);
176 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums);
177
178 class JSTestObjConstructor : public DOMConstructorObject {
179 private:
180     JSTestObjConstructor(JSC::Structure*, JSDOMGlobalObject*);
181     void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
182
183 public:
184     typedef DOMConstructorObject Base;
185     static JSTestObjConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
186     {
187         JSTestObjConstructor* ptr = new (JSC::allocateCell<JSTestObjConstructor>(*exec->heap())) JSTestObjConstructor(structure, globalObject);
188         ptr->finishCreation(exec, globalObject);
189         return ptr;
190     }
191
192     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
193     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
194     static const JSC::ClassInfo s_info;
195     static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
196     {
197         return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
198     }
199 protected:
200     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
201 };
202
203 const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
204
205 JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
206     : DOMConstructorObject(structure, globalObject)
207 {
208 }
209
210 void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
211 {
212     Base::finishCreation(exec->globalData());
213     ASSERT(inherits(&s_info));
214     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
215 }
216
217 bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
218 {
219     return getStaticValueSlot<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, this, propertyName, slot);
220 }
221
222 bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
223 {
224     return getStaticValueDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, this, propertyName, descriptor);
225 }
226
227 /* Hash table for prototype */
228 #if ENABLE(JIT)
229 #define THUNK_GENERATOR(generator) , generator
230 #else
231 #define THUNK_GENERATOR(generator)
232 #endif
233 #if ENABLE(DFG_JIT)
234 #define INTRINSIC(intrinsic) , intrinsic
235 #else
236 #define INTRINSIC(intrinsic)
237 #endif
238
239 static const HashTableValue JSTestObjPrototypeTableValues[] =
240 {
241     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
242     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
243     { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
244     { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
245     { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
246     { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
247     { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
248     { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
249     { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
250     { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
251     { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
252     { "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
253     { "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
254     { "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
255     { "intMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
256     { "objMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
257     { "objMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
258     { "methodThatRequiresAllArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgs), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
259     { "methodThatRequiresAllArgsAndThrows", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
260     { "serializedValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
261     { "idbKey", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIdbKey), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
262     { "optionsObject", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
263     { "methodWithException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
264     { "customMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
265     { "customMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
266     { "customArgsAndException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
267     { "addEventListener", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
268     { "removeEventListener", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
269     { "withDynamicFrame", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrame), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
270     { "withDynamicFrameAndArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndArg), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
271     { "withDynamicFrameAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
272     { "withDynamicFrameAndUserGesture", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
273     { "withDynamicFrameAndUserGestureASAD", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
274     { "withScriptStateVoid", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
275     { "withScriptStateObj", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
276     { "withScriptStateVoidException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
277     { "withScriptStateObjException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
278     { "withScriptExecutionContext", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
279     { "methodWithOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
280     { "methodWithNonOptionalArgAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
281     { "methodWithNonOptionalArgAndTwoOptionalArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
282     { "methodWithCallbackArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
283     { "methodWithNonCallbackArgAndCallbackArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
284     { "methodWithCallbackAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
285 #if ENABLE(Condition1)
286     { "conditionalMethod1", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod1), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
287 #endif
288 #if ENABLE(Condition1) && ENABLE(Condition2)
289     { "conditionalMethod2", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod2), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
290 #endif
291 #if ENABLE(Condition1) || ENABLE(Condition2)
292     { "conditionalMethod3", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
293 #endif
294     { "overloadedMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
295     { "classMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethod), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
296     { "classMethodWithOptional", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethodWithOptional), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
297     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
298 };
299
300 #undef THUNK_GENERATOR
301 static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 137, 127, JSTestObjPrototypeTableValues, 0 };
302 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSNonFinalObject::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
303
304 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
305 {
306     return getDOMPrototype<JSTestObj>(exec, globalObject);
307 }
308
309 bool JSTestObjPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
310 {
311     return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, slot);
312 }
313
314 bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
315 {
316     return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
317 }
318
319 const ClassInfo JSTestObj::s_info = { "TestObj", &JSDOMWrapper::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) };
320
321 JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
322     : JSDOMWrapper(structure, globalObject)
323     , m_impl(impl)
324 {
325 }
326
327 void JSTestObj::finishCreation(JSGlobalData& globalData)
328 {
329     Base::finishCreation(globalData);
330     ASSERT(inherits(&s_info));
331 }
332
333 JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
334 {
335     return JSTestObjPrototype::create(exec->globalData(), globalObject, JSTestObjPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
336 }
337
338 bool JSTestObj::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
339 {
340     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
341     return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, slot);
342 }
343
344 bool JSTestObj::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
345 {
346     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
347     return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, descriptor);
348 }
349
350 JSValue jsTestObjReadOnlyIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
351 {
352     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
353     UNUSED_PARAM(exec);
354     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
355     JSValue result = jsNumber(imp->readOnlyIntAttr());
356     return result;
357 }
358
359
360 JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
361 {
362     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
363     UNUSED_PARAM(exec);
364     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
365     JSValue result = jsString(exec, imp->readOnlyStringAttr());
366     return result;
367 }
368
369
370 JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
371 {
372     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
373     UNUSED_PARAM(exec);
374     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
375     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->readOnlyTestObjAttr()));
376     return result;
377 }
378
379
380 JSValue jsTestObjShortAttr(ExecState* exec, JSValue slotBase, const Identifier&)
381 {
382     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
383     UNUSED_PARAM(exec);
384     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
385     JSValue result = jsNumber(imp->shortAttr());
386     return result;
387 }
388
389
390 JSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSValue slotBase, const Identifier&)
391 {
392     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
393     UNUSED_PARAM(exec);
394     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
395     JSValue result = jsNumber(imp->unsignedShortAttr());
396     return result;
397 }
398
399
400 JSValue jsTestObjIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
401 {
402     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
403     UNUSED_PARAM(exec);
404     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
405     JSValue result = jsNumber(imp->intAttr());
406     return result;
407 }
408
409
410 JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
411 {
412     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
413     UNUSED_PARAM(exec);
414     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
415     JSValue result = jsNumber(imp->longLongAttr());
416     return result;
417 }
418
419
420 JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
421 {
422     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
423     UNUSED_PARAM(exec);
424     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
425     JSValue result = jsNumber(imp->unsignedLongLongAttr());
426     return result;
427 }
428
429
430 JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
431 {
432     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
433     UNUSED_PARAM(exec);
434     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
435     JSValue result = jsString(exec, imp->stringAttr());
436     return result;
437 }
438
439
440 JSValue jsTestObjTestObjAttr(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 = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->testObjAttr()));
446     return result;
447 }
448
449
450 JSValue jsTestObjXMLObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
451 {
452     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
453     UNUSED_PARAM(exec);
454     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
455     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->xmlObjAttr()));
456     return result;
457 }
458
459
460 JSValue jsTestObjCreate(ExecState* exec, JSValue slotBase, const Identifier&)
461 {
462     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
463     UNUSED_PARAM(exec);
464     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
465     JSValue result = jsBoolean(imp->isCreate());
466     return result;
467 }
468
469
470 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
471 {
472     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
473     UNUSED_PARAM(exec);
474     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
475     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
476     return result;
477 }
478
479
480 JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
481 {
482     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
483     UNUSED_PARAM(exec);
484     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
485     JSValue result = jsNumber(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
486     return result;
487 }
488
489
490 JSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
491 {
492     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
493     UNUSED_PARAM(exec);
494     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
495     JSValue result = jsNumber(std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
496     return result;
497 }
498
499
500 JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
501 {
502     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
503     UNUSED_PARAM(exec);
504     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
505     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
506     return result;
507 }
508
509
510 JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
511 {
512     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
513     UNUSED_PARAM(exec);
514     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
515     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
516     return result;
517 }
518
519
520 JSValue jsTestObjReflectedNonEmptyURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
521 {
522     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
523     UNUSED_PARAM(exec);
524     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
525     JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr));
526     return result;
527 }
528
529
530 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
531 {
532     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
533     UNUSED_PARAM(exec);
534     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
535     JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
536     return result;
537 }
538
539
540 JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
541 {
542     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
543     UNUSED_PARAM(exec);
544     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
545     JSValue result = jsNumber(imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
546     return result;
547 }
548
549
550 JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
551 {
552     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
553     UNUSED_PARAM(exec);
554     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
555     JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
556     return result;
557 }
558
559
560 JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
561 {
562     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
563     UNUSED_PARAM(exec);
564     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
565     JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
566     return result;
567 }
568
569
570 JSValue jsTestObjReflectedCustomNonEmptyURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
571 {
572     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
573     UNUSED_PARAM(exec);
574     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
575     JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr));
576     return result;
577 }
578
579
580 JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
581 {
582     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
583     ExceptionCode ec = 0;
584     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
585     JSC::JSValue result = jsNumber(imp->attrWithGetterException(ec));
586     setDOMException(exec, ec);
587     return result;
588 }
589
590
591 JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
592 {
593     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
594     UNUSED_PARAM(exec);
595     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
596     JSValue result = jsNumber(imp->attrWithSetterException());
597     return result;
598 }
599
600
601 JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
602 {
603     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
604     ExceptionCode ec = 0;
605     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
606     JSC::JSValue result = jsString(exec, imp->stringAttrWithGetterException(ec));
607     setDOMException(exec, ec);
608     return result;
609 }
610
611
612 JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
613 {
614     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
615     UNUSED_PARAM(exec);
616     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
617     JSValue result = jsString(exec, imp->stringAttrWithSetterException());
618     return result;
619 }
620
621
622 JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier&)
623 {
624     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
625     return castedThis->customAttr(exec);
626 }
627
628
629 JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
630 {
631     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
632     UNUSED_PARAM(exec);
633     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
634     JSValue result = jsOwnedStringOrNull(exec, imp->scriptStringAttr());
635     return result;
636 }
637
638
639 #if ENABLE(Condition1)
640 JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
641 {
642     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
643     UNUSED_PARAM(exec);
644     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
645     JSValue result = jsNumber(imp->conditionalAttr1());
646     return result;
647 }
648
649 #endif
650
651 #if ENABLE(Condition1) && ENABLE(Condition2)
652 JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&)
653 {
654     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
655     UNUSED_PARAM(exec);
656     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
657     JSValue result = jsNumber(imp->conditionalAttr2());
658     return result;
659 }
660
661 #endif
662
663 #if ENABLE(Condition1) || ENABLE(Condition2)
664 JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&)
665 {
666     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
667     UNUSED_PARAM(exec);
668     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
669     JSValue result = jsNumber(imp->conditionalAttr3());
670     return result;
671 }
672
673 #endif
674
675 #if ENABLE(Condition1)
676 JSValue jsTestObjConditionalAttr4Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
677 {
678     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
679     return JSTestObjectA::getConstructor(exec, castedThis);
680 }
681
682 #endif
683
684 #if ENABLE(Condition1) && ENABLE(Condition2)
685 JSValue jsTestObjConditionalAttr5Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
686 {
687     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
688     return JSTestObjectB::getConstructor(exec, castedThis);
689 }
690
691 #endif
692
693 #if ENABLE(Condition1) || ENABLE(Condition2)
694 JSValue jsTestObjConditionalAttr6Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
695 {
696     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
697     return JSTestObjectC::getConstructor(exec, castedThis);
698 }
699
700 #endif
701
702 JSValue jsTestObjCachedAttribute1(ExecState* exec, JSValue slotBase, const Identifier&)
703 {
704     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
705     UNUSED_PARAM(exec);
706     if (JSValue cachedValue = m_cachedAttribute1.get())
707         return cachedValue;
708     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
709     JSValue result = imp->cachedAttribute1() ? imp->cachedAttribute1()->deserialize(exec, castedThis->globalObject()) : jsNull();
710     m_cachedAttribute1.set(exec->globalData(), this, result);
711     return result;
712 }
713
714
715 JSValue jsTestObjCachedAttribute2(ExecState* exec, JSValue slotBase, const Identifier&)
716 {
717     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
718     UNUSED_PARAM(exec);
719     if (JSValue cachedValue = m_cachedAttribute2.get())
720         return cachedValue;
721     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
722     JSValue result = imp->cachedAttribute2() ? imp->cachedAttribute2()->deserialize(exec, castedThis->globalObject()) : jsNull();
723     m_cachedAttribute2.set(exec->globalData(), this, result);
724     return result;
725 }
726
727
728 JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
729 {
730     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
731     UNUSED_PARAM(exec);
732     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
733     JSValue result = jsNumber(imp->description());
734     return result;
735 }
736
737
738 JSValue jsTestObjId(ExecState* exec, JSValue slotBase, const Identifier&)
739 {
740     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
741     UNUSED_PARAM(exec);
742     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
743     JSValue result = jsNumber(imp->id());
744     return result;
745 }
746
747
748 JSValue jsTestObjHash(ExecState* exec, JSValue slotBase, const Identifier&)
749 {
750     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
751     UNUSED_PARAM(exec);
752     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
753     JSValue result = jsString(exec, imp->hash());
754     return result;
755 }
756
757
758 JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
759 {
760     JSTestObj* domObject = static_cast<JSTestObj*>(asObject(slotBase));
761     return JSTestObj::getConstructor(exec, domObject->globalObject());
762 }
763
764 void JSTestObj::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
765 {
766     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
767     lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, this, slot);
768 }
769
770 void setJSTestObjShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
771 {
772     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
773     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
774     imp->setShortAttr(value.toInt32(exec));
775 }
776
777
778 void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
779 {
780     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
781     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
782     imp->setUnsignedShortAttr(value.toUInt32(exec));
783 }
784
785
786 void setJSTestObjIntAttr(ExecState* exec, JSObject* thisObject, JSValue value)
787 {
788     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
789     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
790     imp->setIntAttr(value.toInt32(exec));
791 }
792
793
794 void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
795 {
796     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
797     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
798     imp->setLongLongAttr(static_cast<long long>(value.toInteger(exec)));
799 }
800
801
802 void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
803 {
804     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
805     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
806     imp->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec)));
807 }
808
809
810 void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
811 {
812     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
813     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
814     imp->setStringAttr(ustringToString(value.toString(exec)));
815 }
816
817
818 void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
819 {
820     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
821     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
822     imp->setTestObjAttr(toTestObj(value));
823 }
824
825
826 void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
827 {
828     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
829     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
830     imp->setXMLObjAttr(toTestObj(value));
831 }
832
833
834 void setJSTestObjCreate(ExecState* exec, JSObject* thisObject, JSValue value)
835 {
836     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
837     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
838     imp->setCreate(value.toBoolean(exec));
839 }
840
841
842 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
843 {
844     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
845     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
846     imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
847 }
848
849
850 void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
851 {
852     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
853     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
854     imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec));
855 }
856
857
858 void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
859 {
860     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
861     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
862     imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, value.toUInt32(exec));
863 }
864
865
866 void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
867 {
868     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
869     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
870     imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
871 }
872
873
874 void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
875 {
876     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
877     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
878     imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
879 }
880
881
882 void setJSTestObjReflectedNonEmptyURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
883 {
884     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
885     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
886     imp->setAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr, valueToStringWithNullCheck(exec, value));
887 }
888
889
890 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
891 {
892     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
893     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
894     imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
895 }
896
897
898 void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
899 {
900     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
901     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
902     imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec));
903 }
904
905
906 void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
907 {
908     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
909     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
910     imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
911 }
912
913
914 void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
915 {
916     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
917     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
918     imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
919 }
920
921
922 void setJSTestObjReflectedCustomNonEmptyURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
923 {
924     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
925     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
926     imp->setAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr, valueToStringWithNullCheck(exec, value));
927 }
928
929
930 void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
931 {
932     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
933     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
934     ExceptionCode ec = 0;
935     imp->setAttrWithGetterException(value.toInt32(exec), ec);
936     setDOMException(exec, ec);
937 }
938
939
940 void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
941 {
942     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
943     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
944     ExceptionCode ec = 0;
945     imp->setAttrWithSetterException(value.toInt32(exec), ec);
946     setDOMException(exec, ec);
947 }
948
949
950 void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
951 {
952     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
953     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
954     ExceptionCode ec = 0;
955     imp->setStringAttrWithGetterException(ustringToString(value.toString(exec)), ec);
956     setDOMException(exec, ec);
957 }
958
959
960 void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
961 {
962     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
963     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
964     ExceptionCode ec = 0;
965     imp->setStringAttrWithSetterException(ustringToString(value.toString(exec)), ec);
966     setDOMException(exec, ec);
967 }
968
969
970 void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value)
971 {
972     static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
973 }
974
975
976 #if ENABLE(Condition1)
977 void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
978 {
979     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
980     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
981     imp->setConditionalAttr1(value.toInt32(exec));
982 }
983
984 #endif
985
986 #if ENABLE(Condition1) && ENABLE(Condition2)
987 void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value)
988 {
989     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
990     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
991     imp->setConditionalAttr2(value.toInt32(exec));
992 }
993
994 #endif
995
996 #if ENABLE(Condition1) || ENABLE(Condition2)
997 void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value)
998 {
999     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1000     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1001     imp->setConditionalAttr3(value.toInt32(exec));
1002 }
1003
1004 #endif
1005
1006 #if ENABLE(Condition1)
1007 void setJSTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1008 {
1009     // Shadowing a built-in constructor
1010     static_cast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr4"), value);
1011 }
1012
1013 #endif
1014
1015 #if ENABLE(Condition1) && ENABLE(Condition2)
1016 void setJSTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1017 {
1018     // Shadowing a built-in constructor
1019     static_cast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr5"), value);
1020 }
1021
1022 #endif
1023
1024 #if ENABLE(Condition1) || ENABLE(Condition2)
1025 void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1026 {
1027     // Shadowing a built-in constructor
1028     static_cast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr6"), value);
1029 }
1030
1031 #endif
1032
1033 void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
1034 {
1035     JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1036     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1037     imp->setId(value.toInt32(exec));
1038 }
1039
1040
1041 JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
1042 {
1043     return getDOMConstructor<JSTestObjConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
1044 }
1045
1046 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec)
1047 {
1048     JSValue thisValue = exec->hostThisValue();
1049     if (!thisValue.inherits(&JSTestObj::s_info))
1050         return throwVMTypeError(exec);
1051     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1052     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1053     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1054
1055     imp->voidMethod();
1056     return JSValue::encode(jsUndefined());
1057 }
1058
1059 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec)
1060 {
1061     JSValue thisValue = exec->hostThisValue();
1062     if (!thisValue.inherits(&JSTestObj::s_info))
1063         return throwVMTypeError(exec);
1064     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1065     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1066     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1067     int intArg(exec->argument(0).toInt32(exec));
1068     if (exec->hadException())
1069         return JSValue::encode(jsUndefined());
1070     const String& strArg(ustringToString(exec->argument(1).toString(exec)));
1071     if (exec->hadException())
1072         return JSValue::encode(jsUndefined());
1073     TestObj* objArg(toTestObj(exec->argument(2)));
1074     if (exec->hadException())
1075         return JSValue::encode(jsUndefined());
1076
1077     imp->voidMethodWithArgs(intArg, strArg, objArg);
1078     return JSValue::encode(jsUndefined());
1079 }
1080
1081 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec)
1082 {
1083     JSValue thisValue = exec->hostThisValue();
1084     if (!thisValue.inherits(&JSTestObj::s_info))
1085         return throwVMTypeError(exec);
1086     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1087     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1088     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1089
1090
1091     JSC::JSValue result = jsNumber(imp->intMethod());
1092     return JSValue::encode(result);
1093 }
1094
1095 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecState* exec)
1096 {
1097     JSValue thisValue = exec->hostThisValue();
1098     if (!thisValue.inherits(&JSTestObj::s_info))
1099         return throwVMTypeError(exec);
1100     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1101     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1102     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1103     int intArg(exec->argument(0).toInt32(exec));
1104     if (exec->hadException())
1105         return JSValue::encode(jsUndefined());
1106     const String& strArg(ustringToString(exec->argument(1).toString(exec)));
1107     if (exec->hadException())
1108         return JSValue::encode(jsUndefined());
1109     TestObj* objArg(toTestObj(exec->argument(2)));
1110     if (exec->hadException())
1111         return JSValue::encode(jsUndefined());
1112
1113
1114     JSC::JSValue result = jsNumber(imp->intMethodWithArgs(intArg, strArg, objArg));
1115     return JSValue::encode(result);
1116 }
1117
1118 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec)
1119 {
1120     JSValue thisValue = exec->hostThisValue();
1121     if (!thisValue.inherits(&JSTestObj::s_info))
1122         return throwVMTypeError(exec);
1123     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1124     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1125     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1126
1127
1128     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethod()));
1129     return JSValue::encode(result);
1130 }
1131
1132 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec)
1133 {
1134     JSValue thisValue = exec->hostThisValue();
1135     if (!thisValue.inherits(&JSTestObj::s_info))
1136         return throwVMTypeError(exec);
1137     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1138     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1139     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1140     int intArg(exec->argument(0).toInt32(exec));
1141     if (exec->hadException())
1142         return JSValue::encode(jsUndefined());
1143     const String& strArg(ustringToString(exec->argument(1).toString(exec)));
1144     if (exec->hadException())
1145         return JSValue::encode(jsUndefined());
1146     TestObj* objArg(toTestObj(exec->argument(2)));
1147     if (exec->hadException())
1148         return JSValue::encode(jsUndefined());
1149
1150
1151     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethodWithArgs(intArg, strArg, objArg)));
1152     return JSValue::encode(result);
1153 }
1154
1155 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgs(ExecState* exec)
1156 {
1157     JSValue thisValue = exec->hostThisValue();
1158     if (!thisValue.inherits(&JSTestObj::s_info))
1159         return throwVMTypeError(exec);
1160     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1161     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1162     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1163     if (exec->argumentCount() < 2)
1164         return JSValue::encode(jsUndefined());
1165     const String& strArg(ustringToString(exec->argument(0).toString(exec)));
1166     if (exec->hadException())
1167         return JSValue::encode(jsUndefined());
1168     TestObj* objArg(toTestObj(exec->argument(1)));
1169     if (exec->hadException())
1170         return JSValue::encode(jsUndefined());
1171
1172
1173     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgs(strArg, objArg)));
1174     return JSValue::encode(result);
1175 }
1176
1177 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec)
1178 {
1179     JSValue thisValue = exec->hostThisValue();
1180     if (!thisValue.inherits(&JSTestObj::s_info))
1181         return throwVMTypeError(exec);
1182     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1183     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1184     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1185     if (exec->argumentCount() < 2)
1186         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1187     ExceptionCode ec = 0;
1188     const String& strArg(ustringToString(exec->argument(0).toString(exec)));
1189     if (exec->hadException())
1190         return JSValue::encode(jsUndefined());
1191     TestObj* objArg(toTestObj(exec->argument(1)));
1192     if (exec->hadException())
1193         return JSValue::encode(jsUndefined());
1194
1195
1196     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
1197     setDOMException(exec, ec);
1198     return JSValue::encode(result);
1199 }
1200
1201 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec)
1202 {
1203     JSValue thisValue = exec->hostThisValue();
1204     if (!thisValue.inherits(&JSTestObj::s_info))
1205         return throwVMTypeError(exec);
1206     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1207     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1208     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1209     RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0)));
1210     if (exec->hadException())
1211         return JSValue::encode(jsUndefined());
1212
1213     imp->serializedValue(serializedArg);
1214     return JSValue::encode(jsUndefined());
1215 }
1216
1217 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec)
1218 {
1219     JSValue thisValue = exec->hostThisValue();
1220     if (!thisValue.inherits(&JSTestObj::s_info))
1221         return throwVMTypeError(exec);
1222     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1223     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1224     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1225     RefPtr<IDBKey> key(createIDBKeyFromValue(exec, exec->argument(0)));
1226     if (exec->hadException())
1227         return JSValue::encode(jsUndefined());
1228
1229     imp->idbKey(key);
1230     return JSValue::encode(jsUndefined());
1231 }
1232
1233 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec)
1234 {
1235     JSValue thisValue = exec->hostThisValue();
1236     if (!thisValue.inherits(&JSTestObj::s_info))
1237         return throwVMTypeError(exec);
1238     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1239     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1240     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1241     OptionsObject* oo(toOptionsObject(exec->argument(0)));
1242     if (exec->hadException())
1243         return JSValue::encode(jsUndefined());
1244
1245     size_t argsCount = exec->argumentCount();
1246     if (argsCount <= 1) {
1247         imp->optionsObject(oo);
1248         return JSValue::encode(jsUndefined());
1249     }
1250
1251     OptionsObject* ooo(toOptionsObject(exec->argument(1)));
1252     if (exec->hadException())
1253         return JSValue::encode(jsUndefined());
1254
1255     imp->optionsObject(oo, ooo);
1256     return JSValue::encode(jsUndefined());
1257 }
1258
1259 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec)
1260 {
1261     JSValue thisValue = exec->hostThisValue();
1262     if (!thisValue.inherits(&JSTestObj::s_info))
1263         return throwVMTypeError(exec);
1264     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1265     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1266     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1267     ExceptionCode ec = 0;
1268
1269     imp->methodWithException(ec);
1270     setDOMException(exec, ec);
1271     return JSValue::encode(jsUndefined());
1272 }
1273
1274 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec)
1275 {
1276     JSValue thisValue = exec->hostThisValue();
1277     if (!thisValue.inherits(&JSTestObj::s_info))
1278         return throwVMTypeError(exec);
1279     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1280     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1281     return JSValue::encode(castedThis->customMethod(exec));
1282 }
1283
1284 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec)
1285 {
1286     JSValue thisValue = exec->hostThisValue();
1287     if (!thisValue.inherits(&JSTestObj::s_info))
1288         return throwVMTypeError(exec);
1289     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1290     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1291     return JSValue::encode(castedThis->customMethodWithArgs(exec));
1292 }
1293
1294 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(ExecState* exec)
1295 {
1296     JSValue thisValue = exec->hostThisValue();
1297     if (!thisValue.inherits(&JSTestObj::s_info))
1298         return throwVMTypeError(exec);
1299     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1300     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1301     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1302     ExceptionCode ec = 0;
1303     RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 1));
1304     size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1;
1305     RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize));
1306     log* intArg(tolog(exec->argument(0)));
1307     if (exec->hadException())
1308         return JSValue::encode(jsUndefined());
1309
1310     imp->customArgsAndException(intArg, scriptArguments, callStack, ec);
1311     setDOMException(exec, ec);
1312     return JSValue::encode(jsUndefined());
1313 }
1314
1315 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec)
1316 {
1317     JSValue thisValue = exec->hostThisValue();
1318     if (!thisValue.inherits(&JSTestObj::s_info))
1319         return throwVMTypeError(exec);
1320     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1321     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1322     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1323     JSValue listener = exec->argument(1);
1324     if (!listener.isObject())
1325         return JSValue::encode(jsUndefined());
1326     imp->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
1327     return JSValue::encode(jsUndefined());
1328 }
1329
1330 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec)
1331 {
1332     JSValue thisValue = exec->hostThisValue();
1333     if (!thisValue.inherits(&JSTestObj::s_info))
1334         return throwVMTypeError(exec);
1335     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1336     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1337     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1338     JSValue listener = exec->argument(1);
1339     if (!listener.isObject())
1340         return JSValue::encode(jsUndefined());
1341     imp->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
1342     return JSValue::encode(jsUndefined());
1343 }
1344
1345 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(ExecState* exec)
1346 {
1347     JSValue thisValue = exec->hostThisValue();
1348     if (!thisValue.inherits(&JSTestObj::s_info))
1349         return throwVMTypeError(exec);
1350     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1351     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1352     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1353     Frame* dynamicFrame = toDynamicFrame(exec);
1354     if (!dynamicFrame)
1355         return JSValue::encode(jsUndefined());
1356
1357     imp->withDynamicFrame(dynamicFrame);
1358     return JSValue::encode(jsUndefined());
1359 }
1360
1361 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(ExecState* exec)
1362 {
1363     JSValue thisValue = exec->hostThisValue();
1364     if (!thisValue.inherits(&JSTestObj::s_info))
1365         return throwVMTypeError(exec);
1366     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1367     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1368     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1369     Frame* dynamicFrame = toDynamicFrame(exec);
1370     if (!dynamicFrame)
1371         return JSValue::encode(jsUndefined());
1372     int intArg(exec->argument(0).toInt32(exec));
1373     if (exec->hadException())
1374         return JSValue::encode(jsUndefined());
1375
1376     imp->withDynamicFrameAndArg(dynamicFrame, intArg);
1377     return JSValue::encode(jsUndefined());
1378 }
1379
1380 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(ExecState* exec)
1381 {
1382     JSValue thisValue = exec->hostThisValue();
1383     if (!thisValue.inherits(&JSTestObj::s_info))
1384         return throwVMTypeError(exec);
1385     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1386     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1387     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1388     Frame* dynamicFrame = toDynamicFrame(exec);
1389     if (!dynamicFrame)
1390         return JSValue::encode(jsUndefined());
1391     int intArg(exec->argument(0).toInt32(exec));
1392     if (exec->hadException())
1393         return JSValue::encode(jsUndefined());
1394
1395     size_t argsCount = exec->argumentCount();
1396     if (argsCount <= 1) {
1397         imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg);
1398         return JSValue::encode(jsUndefined());
1399     }
1400
1401     int optionalArg(exec->argument(1).toInt32(exec));
1402     if (exec->hadException())
1403         return JSValue::encode(jsUndefined());
1404
1405     imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg, optionalArg);
1406     return JSValue::encode(jsUndefined());
1407 }
1408
1409 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(ExecState* exec)
1410 {
1411     JSValue thisValue = exec->hostThisValue();
1412     if (!thisValue.inherits(&JSTestObj::s_info))
1413         return throwVMTypeError(exec);
1414     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1415     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1416     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1417     Frame* dynamicFrame = toDynamicFrame(exec);
1418     if (!dynamicFrame)
1419         return JSValue::encode(jsUndefined());
1420     int intArg(exec->argument(0).toInt32(exec));
1421     if (exec->hadException())
1422         return JSValue::encode(jsUndefined());
1423
1424     imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, ScriptController::processingUserGesture());
1425     return JSValue::encode(jsUndefined());
1426 }
1427
1428 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(ExecState* exec)
1429 {
1430     JSValue thisValue = exec->hostThisValue();
1431     if (!thisValue.inherits(&JSTestObj::s_info))
1432         return throwVMTypeError(exec);
1433     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1434     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1435     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1436     Frame* dynamicFrame = toDynamicFrame(exec);
1437     if (!dynamicFrame)
1438         return JSValue::encode(jsUndefined());
1439     int intArg(exec->argument(0).toInt32(exec));
1440     if (exec->hadException())
1441         return JSValue::encode(jsUndefined());
1442
1443     size_t argsCount = exec->argumentCount();
1444     if (argsCount <= 1) {
1445         imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg);
1446         return JSValue::encode(jsUndefined());
1447     }
1448
1449     int optionalArg(exec->argument(1).toInt32(exec));
1450     if (exec->hadException())
1451         return JSValue::encode(jsUndefined());
1452
1453     imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, ScriptController::processingUserGesture());
1454     return JSValue::encode(jsUndefined());
1455 }
1456
1457 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec)
1458 {
1459     JSValue thisValue = exec->hostThisValue();
1460     if (!thisValue.inherits(&JSTestObj::s_info))
1461         return throwVMTypeError(exec);
1462     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1463     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1464     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1465
1466     imp->withScriptStateVoid(exec);
1467     return JSValue::encode(jsUndefined());
1468 }
1469
1470 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec)
1471 {
1472     JSValue thisValue = exec->hostThisValue();
1473     if (!thisValue.inherits(&JSTestObj::s_info))
1474         return throwVMTypeError(exec);
1475     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1476     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1477     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1478
1479
1480     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObj(exec)));
1481     if (exec->hadException())
1482         return JSValue::encode(jsUndefined());
1483     return JSValue::encode(result);
1484 }
1485
1486 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec)
1487 {
1488     JSValue thisValue = exec->hostThisValue();
1489     if (!thisValue.inherits(&JSTestObj::s_info))
1490         return throwVMTypeError(exec);
1491     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1492     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1493     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1494     ExceptionCode ec = 0;
1495
1496     imp->withScriptStateVoidException(exec, ec);
1497     setDOMException(exec, ec);
1498     return JSValue::encode(jsUndefined());
1499 }
1500
1501 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec)
1502 {
1503     JSValue thisValue = exec->hostThisValue();
1504     if (!thisValue.inherits(&JSTestObj::s_info))
1505         return throwVMTypeError(exec);
1506     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1507     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1508     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1509     ExceptionCode ec = 0;
1510
1511
1512     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObjException(exec, ec)));
1513     setDOMException(exec, ec);
1514     if (exec->hadException())
1515         return JSValue::encode(jsUndefined());
1516     return JSValue::encode(result);
1517 }
1518
1519 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
1520 {
1521     JSValue thisValue = exec->hostThisValue();
1522     if (!thisValue.inherits(&JSTestObj::s_info))
1523         return throwVMTypeError(exec);
1524     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1525     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1526     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1527     ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1528     if (!scriptContext)
1529         return JSValue::encode(jsUndefined());
1530
1531     imp->withScriptExecutionContext(scriptContext);
1532     return JSValue::encode(jsUndefined());
1533 }
1534
1535 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec)
1536 {
1537     JSValue thisValue = exec->hostThisValue();
1538     if (!thisValue.inherits(&JSTestObj::s_info))
1539         return throwVMTypeError(exec);
1540     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1541     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1542     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1543
1544     size_t argsCount = exec->argumentCount();
1545     if (argsCount <= 0) {
1546         imp->methodWithOptionalArg();
1547         return JSValue::encode(jsUndefined());
1548     }
1549
1550     int opt(exec->argument(0).toInt32(exec));
1551     if (exec->hadException())
1552         return JSValue::encode(jsUndefined());
1553
1554     imp->methodWithOptionalArg(opt);
1555     return JSValue::encode(jsUndefined());
1556 }
1557
1558 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec)
1559 {
1560     JSValue thisValue = exec->hostThisValue();
1561     if (!thisValue.inherits(&JSTestObj::s_info))
1562         return throwVMTypeError(exec);
1563     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1564     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1565     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1566     int nonOpt(exec->argument(0).toInt32(exec));
1567     if (exec->hadException())
1568         return JSValue::encode(jsUndefined());
1569
1570     size_t argsCount = exec->argumentCount();
1571     if (argsCount <= 1) {
1572         imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
1573         return JSValue::encode(jsUndefined());
1574     }
1575
1576     int opt(exec->argument(1).toInt32(exec));
1577     if (exec->hadException())
1578         return JSValue::encode(jsUndefined());
1579
1580     imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
1581     return JSValue::encode(jsUndefined());
1582 }
1583
1584 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec)
1585 {
1586     JSValue thisValue = exec->hostThisValue();
1587     if (!thisValue.inherits(&JSTestObj::s_info))
1588         return throwVMTypeError(exec);
1589     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1590     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1591     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1592     int nonOpt(exec->argument(0).toInt32(exec));
1593     if (exec->hadException())
1594         return JSValue::encode(jsUndefined());
1595
1596     size_t argsCount = exec->argumentCount();
1597     if (argsCount <= 1) {
1598         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
1599         return JSValue::encode(jsUndefined());
1600     }
1601
1602     int opt1(exec->argument(1).toInt32(exec));
1603     if (exec->hadException())
1604         return JSValue::encode(jsUndefined());
1605     int opt2(exec->argument(2).toInt32(exec));
1606     if (exec->hadException())
1607         return JSValue::encode(jsUndefined());
1608
1609     imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
1610     return JSValue::encode(jsUndefined());
1611 }
1612
1613 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* exec)
1614 {
1615     JSValue thisValue = exec->hostThisValue();
1616     if (!thisValue.inherits(&JSTestObj::s_info))
1617         return throwVMTypeError(exec);
1618     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1619     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1620     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1621     if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) {
1622         setDOMException(exec, TYPE_MISMATCH_ERR);
1623         return JSValue::encode(jsUndefined());
1624     }
1625     RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1626
1627     imp->methodWithCallbackArg(callback);
1628     return JSValue::encode(jsUndefined());
1629 }
1630
1631 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec)
1632 {
1633     JSValue thisValue = exec->hostThisValue();
1634     if (!thisValue.inherits(&JSTestObj::s_info))
1635         return throwVMTypeError(exec);
1636     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1637     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1638     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1639     int nonCallback(exec->argument(0).toInt32(exec));
1640     if (exec->hadException())
1641         return JSValue::encode(jsUndefined());
1642     if (exec->argumentCount() <= 1 || !exec->argument(1).isObject()) {
1643         setDOMException(exec, TYPE_MISMATCH_ERR);
1644         return JSValue::encode(jsUndefined());
1645     }
1646     RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject());
1647
1648     imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
1649     return JSValue::encode(jsUndefined());
1650 }
1651
1652 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec)
1653 {
1654     JSValue thisValue = exec->hostThisValue();
1655     if (!thisValue.inherits(&JSTestObj::s_info))
1656         return throwVMTypeError(exec);
1657     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1658     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1659     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1660     RefPtr<TestCallback> callback;
1661     if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull()) {
1662         if (!exec->argument(0).isObject()) {
1663             setDOMException(exec, TYPE_MISMATCH_ERR);
1664             return JSValue::encode(jsUndefined());
1665         }
1666         callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1667     }
1668
1669     imp->methodWithCallbackAndOptionalArg(callback);
1670     return JSValue::encode(jsUndefined());
1671 }
1672
1673 #if ENABLE(Condition1)
1674 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod1(ExecState* exec)
1675 {
1676     JSValue thisValue = exec->hostThisValue();
1677     if (!thisValue.inherits(&JSTestObj::s_info))
1678         return throwVMTypeError(exec);
1679     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1680     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1681     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1682
1683
1684     JSC::JSValue result = jsString(exec, imp->conditionalMethod1());
1685     return JSValue::encode(result);
1686 }
1687
1688 #endif
1689
1690 #if ENABLE(Condition1) && ENABLE(Condition2)
1691 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod2(ExecState* exec)
1692 {
1693     JSValue thisValue = exec->hostThisValue();
1694     if (!thisValue.inherits(&JSTestObj::s_info))
1695         return throwVMTypeError(exec);
1696     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1697     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1698     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1699
1700     imp->conditionalMethod2();
1701     return JSValue::encode(jsUndefined());
1702 }
1703
1704 #endif
1705
1706 #if ENABLE(Condition1) || ENABLE(Condition2)
1707 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod3(ExecState* exec)
1708 {
1709     JSValue thisValue = exec->hostThisValue();
1710     if (!thisValue.inherits(&JSTestObj::s_info))
1711         return throwVMTypeError(exec);
1712     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1713     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1714     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1715
1716     imp->conditionalMethod3();
1717     return JSValue::encode(jsUndefined());
1718 }
1719
1720 #endif
1721
1722 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
1723 {
1724     JSValue thisValue = exec->hostThisValue();
1725     if (!thisValue.inherits(&JSTestObj::s_info))
1726         return throwVMTypeError(exec);
1727     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1728     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1729     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1730     TestObj* objArg(toTestObj(exec->argument(0)));
1731     if (exec->hadException())
1732         return JSValue::encode(jsUndefined());
1733     const String& strArg(ustringToString(exec->argument(1).toString(exec)));
1734     if (exec->hadException())
1735         return JSValue::encode(jsUndefined());
1736
1737     imp->overloadedMethod(objArg, strArg);
1738     return JSValue::encode(jsUndefined());
1739 }
1740
1741 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
1742 {
1743     JSValue thisValue = exec->hostThisValue();
1744     if (!thisValue.inherits(&JSTestObj::s_info))
1745         return throwVMTypeError(exec);
1746     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1747     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1748     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1749     TestObj* objArg(toTestObj(exec->argument(0)));
1750     if (exec->hadException())
1751         return JSValue::encode(jsUndefined());
1752
1753     size_t argsCount = exec->argumentCount();
1754     if (argsCount <= 1) {
1755         imp->overloadedMethod(objArg);
1756         return JSValue::encode(jsUndefined());
1757     }
1758
1759     int intArg(exec->argument(1).toInt32(exec));
1760     if (exec->hadException())
1761         return JSValue::encode(jsUndefined());
1762
1763     imp->overloadedMethod(objArg, intArg);
1764     return JSValue::encode(jsUndefined());
1765 }
1766
1767 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
1768 {
1769     JSValue thisValue = exec->hostThisValue();
1770     if (!thisValue.inherits(&JSTestObj::s_info))
1771         return throwVMTypeError(exec);
1772     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1773     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1774     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1775     const String& strArg(ustringToString(exec->argument(0).toString(exec)));
1776     if (exec->hadException())
1777         return JSValue::encode(jsUndefined());
1778
1779     imp->overloadedMethod(strArg);
1780     return JSValue::encode(jsUndefined());
1781 }
1782
1783 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
1784 {
1785     JSValue thisValue = exec->hostThisValue();
1786     if (!thisValue.inherits(&JSTestObj::s_info))
1787         return throwVMTypeError(exec);
1788     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1789     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1790     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1791     int intArg(exec->argument(0).toInt32(exec));
1792     if (exec->hadException())
1793         return JSValue::encode(jsUndefined());
1794
1795     imp->overloadedMethod(intArg);
1796     return JSValue::encode(jsUndefined());
1797 }
1798
1799 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod5(ExecState* exec)
1800 {
1801     JSValue thisValue = exec->hostThisValue();
1802     if (!thisValue.inherits(&JSTestObj::s_info))
1803         return throwVMTypeError(exec);
1804     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1805     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1806     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1807     if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) {
1808         setDOMException(exec, TYPE_MISMATCH_ERR);
1809         return JSValue::encode(jsUndefined());
1810     }
1811     RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1812
1813     imp->overloadedMethod(callback);
1814     return JSValue::encode(jsUndefined());
1815 }
1816
1817 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
1818 {
1819     size_t argsCount = exec->argumentCount();
1820     JSValue arg1(exec->argument(1));
1821     JSValue arg0(exec->argument(0));
1822     if ((argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info))) && (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject())))
1823         return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
1824     if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info)))) || (argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info)))))
1825         return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
1826     if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))
1827         return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
1828     if (argsCount == 1)
1829         return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
1830     if ((argsCount == 1 && (arg0.isNull() || arg0.isObject())))
1831         return jsTestObjPrototypeFunctionOverloadedMethod5(exec);
1832     return throwVMTypeError(exec);
1833 }
1834
1835 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethod(ExecState* exec)
1836 {
1837     JSValue thisValue = exec->hostThisValue();
1838     if (!thisValue.inherits(&JSTestObj::s_info))
1839         return throwVMTypeError(exec);
1840     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1841     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1842     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1843
1844     imp->classMethod();
1845     return JSValue::encode(jsUndefined());
1846 }
1847
1848 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithOptional(ExecState* exec)
1849 {
1850     JSValue thisValue = exec->hostThisValue();
1851     if (!thisValue.inherits(&JSTestObj::s_info))
1852         return throwVMTypeError(exec);
1853     JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
1854     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1855     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
1856
1857     size_t argsCount = exec->argumentCount();
1858     if (argsCount <= 0) {
1859
1860         JSC::JSValue result = jsNumber(imp->classMethodWithOptional());
1861         return JSValue::encode(result);
1862     }
1863
1864     int arg(exec->argument(0).toInt32(exec));
1865     if (exec->hadException())
1866         return JSValue::encode(jsUndefined());
1867
1868
1869     JSC::JSValue result = jsNumber(imp->classMethodWithOptional(arg));
1870     return JSValue::encode(result);
1871 }
1872
1873 void JSTestObj::visitChildrenVirtual(SlotVisitor& visitor)
1874 {
1875     visitChildren(this, visitor);
1876 }
1877
1878 void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
1879 {
1880     JSTestObj* thisObject = static_cast<JSTestObj*>(cell);
1881     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
1882     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
1883     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
1884     Base::visitChildren(thisObject, visitor);
1885     if (thisObject->m_cachedAttribute1)
1886         visitor.append(&thisObject->m_cachedAttribute1);
1887     if (thisObject->m_cachedAttribute2)
1888         visitor.append(&thisObject->m_cachedAttribute2);
1889 }
1890
1891 // Constant getters
1892
1893 JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&)
1894 {
1895     UNUSED_PARAM(exec);
1896     return jsNumber(static_cast<int>(0));
1897 }
1898
1899 JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, const Identifier&)
1900 {
1901     UNUSED_PARAM(exec);
1902     return jsNumber(static_cast<int>(1));
1903 }
1904
1905 JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, const Identifier&)
1906 {
1907     UNUSED_PARAM(exec);
1908     return jsNumber(static_cast<int>(2));
1909 }
1910
1911 JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, const Identifier&)
1912 {
1913     UNUSED_PARAM(exec);
1914     return jsNumber(static_cast<int>(4));
1915 }
1916
1917 JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&)
1918 {
1919     UNUSED_PARAM(exec);
1920     return jsNumber(static_cast<int>(8));
1921 }
1922
1923 JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&)
1924 {
1925     UNUSED_PARAM(exec);
1926     return jsNumber(static_cast<int>(-1));
1927 }
1928
1929 JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&)
1930 {
1931     return jsStringOrNull(exec, String("my constant string"));
1932 }
1933
1934 JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&)
1935 {
1936     UNUSED_PARAM(exec);
1937     return jsNumber(static_cast<int>(0xffffffff));
1938 }
1939
1940 JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&)
1941 {
1942     UNUSED_PARAM(exec);
1943     return jsNumber(static_cast<int>(0x01));
1944 }
1945
1946 JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&)
1947 {
1948     UNUSED_PARAM(exec);
1949     return jsNumber(static_cast<int>(0X20));
1950 }
1951
1952 JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&)
1953 {
1954     UNUSED_PARAM(exec);
1955     return jsNumber(static_cast<int>(0x1abc));
1956 }
1957
1958 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* impl)
1959 {
1960     return wrap<JSTestObj>(exec, globalObject, impl);
1961 }
1962
1963 TestObj* toTestObj(JSC::JSValue value)
1964 {
1965     return value.inherits(&JSTestObj::s_info) ? static_cast<JSTestObj*>(asObject(value))->impl() : 0;
1966 }
1967
1968 }