Unreviewed, rebaselined run-bindings-tests results.
[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 "Dictionary.h"
25 #include "Document.h"
26 #include "ExceptionCode.h"
27 #include "HTMLNames.h"
28 #include "IDBBindingUtilities.h"
29 #include "IDBKey.h"
30 #include "JSDOMBinding.h"
31 #include "JSDOMStringList.h"
32 #include "JSDocument.h"
33 #include "JSEventListener.h"
34 #include "JSSVGDocument.h"
35 #include "JSSVGPoint.h"
36 #include "JSScriptProfile.h"
37 #include "JSTestCallback.h"
38 #include "JSTestObj.h"
39 #include "JSa.h"
40 #include "JSb.h"
41 #include "JSbool.h"
42 #include "JSc.h"
43 #include "JSd.h"
44 #include "JSe.h"
45 #include "JSint.h"
46 #include "KURL.h"
47 #include "SVGDocument.h"
48 #include "SVGStaticPropertyTearOff.h"
49 #include "ScriptArguments.h"
50 #include "ScriptCallStack.h"
51 #include "ScriptCallStackFactory.h"
52 #include "ScriptProfile.h"
53 #include "SerializedScriptValue.h"
54 #include "TestObj.h"
55 #include "bool.h"
56 #include <runtime/Error.h>
57 #include <runtime/JSArray.h>
58 #include <runtime/JSString.h>
59 #include <wtf/GetPtr.h>
60
61 #if ENABLE(Condition1)
62 #include "JSTestObjectA.h"
63 #endif
64
65 #if ENABLE(Condition1) && ENABLE(Condition2)
66 #include "JSTestObjectB.h"
67 #endif
68
69 #if ENABLE(Condition1) || ENABLE(Condition2)
70 #include "JSTestObjectC.h"
71 #endif
72
73 using namespace JSC;
74
75 namespace WebCore {
76
77 ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
78 /* Hash table */
79
80 static const HashTableValue JSTestObjTableValues[] =
81 {
82     { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0, NoIntrinsic },
83     { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0, NoIntrinsic },
84     { "readOnlyTestObjAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0, NoIntrinsic },
85     { "shortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjShortAttr), (intptr_t)setJSTestObjShortAttr, NoIntrinsic },
86     { "unsignedShortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedShortAttr), (intptr_t)setJSTestObjUnsignedShortAttr, NoIntrinsic },
87     { "intAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjIntAttr), (intptr_t)setJSTestObjIntAttr, NoIntrinsic },
88     { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr, NoIntrinsic },
89     { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr, NoIntrinsic },
90     { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr, NoIntrinsic },
91     { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr, NoIntrinsic },
92     { "sequenceAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjSequenceAttr), (intptr_t)setJSTestObjSequenceAttr, NoIntrinsic },
93     { "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr, NoIntrinsic },
94     { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate, NoIntrinsic },
95     { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr, NoIntrinsic },
96     { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr, NoIntrinsic },
97     { "reflectedUnsignedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedUnsignedIntegralAttr), (intptr_t)setJSTestObjReflectedUnsignedIntegralAttr, NoIntrinsic },
98     { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr, NoIntrinsic },
99     { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr, NoIntrinsic },
100     { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr, NoIntrinsic },
101     { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr, NoIntrinsic },
102     { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr, NoIntrinsic },
103     { "reflectedCustomURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t)setJSTestObjReflectedCustomURLAttr, NoIntrinsic },
104     { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException, NoIntrinsic },
105     { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException, NoIntrinsic },
106     { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException, NoIntrinsic },
107     { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException, NoIntrinsic },
108     { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr, NoIntrinsic },
109     { "withScriptStateAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttribute), (intptr_t)setJSTestObjWithScriptStateAttribute, NoIntrinsic },
110     { "withScriptExecutionContextAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAttribute, NoIntrinsic },
111     { "withScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptStateAttributeRaises, NoIntrinsic },
112     { "withScriptExecutionContextAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAttributeRaises, NoIntrinsic },
113     { "withScriptExecutionContextAndScriptStateAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttribute, NoIntrinsic },
114     { "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises, NoIntrinsic },
115     { "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute, NoIntrinsic },
116     { "withScriptArgumentsAndCallStackAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t)setJSTestObjWithScriptArgumentsAndCallStackAttribute, NoIntrinsic },
117 #if ENABLE(Condition1)
118     { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1, NoIntrinsic },
119 #endif
120 #if ENABLE(Condition1) && ENABLE(Condition2)
121     { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2, NoIntrinsic },
122 #endif
123 #if ENABLE(Condition1) || ENABLE(Condition2)
124     { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3, NoIntrinsic },
125 #endif
126 #if ENABLE(Condition1)
127     { "conditionalAttr4", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t)setJSTestObjConditionalAttr4Constructor, NoIntrinsic },
128 #endif
129 #if ENABLE(Condition1) && ENABLE(Condition2)
130     { "conditionalAttr5", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr5Constructor), (intptr_t)setJSTestObjConditionalAttr5Constructor, NoIntrinsic },
131 #endif
132 #if ENABLE(Condition1) || ENABLE(Condition2)
133     { "conditionalAttr6", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr6Constructor), (intptr_t)setJSTestObjConditionalAttr6Constructor, NoIntrinsic },
134 #endif
135     { "cachedAttribute1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t)0, NoIntrinsic },
136     { "cachedAttribute2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t)0, NoIntrinsic },
137     { "contentDocument", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t)0, NoIntrinsic },
138     { "mutablePoint", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMutablePoint), (intptr_t)setJSTestObjMutablePoint, NoIntrinsic },
139     { "immutablePoint", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImmutablePoint), (intptr_t)setJSTestObjImmutablePoint, NoIntrinsic },
140     { "strawberry", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrawberry), (intptr_t)setJSTestObjStrawberry, NoIntrinsic },
141     { "strictFloat", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictFloat), (intptr_t)setJSTestObjStrictFloat, NoIntrinsic },
142     { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0, NoIntrinsic },
143     { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId, NoIntrinsic },
144     { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0, NoIntrinsic },
145     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0, NoIntrinsic },
146     { 0, 0, 0, 0, NoIntrinsic }
147 };
148
149 static const HashTable JSTestObjTable = { 138, 127, JSTestObjTableValues, 0 };
150 /* Hash table for constructor */
151
152 static const HashTableValue JSTestObjConstructorTableValues[] =
153 {
154 #if ENABLE(Condition1)
155     { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0, NoIntrinsic },
156 #endif
157     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0, NoIntrinsic },
158     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0, NoIntrinsic },
159     { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0, NoIntrinsic },
160     { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0, NoIntrinsic },
161     { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0, NoIntrinsic },
162     { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0, NoIntrinsic },
163     { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0, NoIntrinsic },
164     { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0, NoIntrinsic },
165     { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0, NoIntrinsic },
166     { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0, NoIntrinsic },
167     { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0, NoIntrinsic },
168     { "CONST_JAVASCRIPT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0, NoIntrinsic },
169     { "classMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod), (intptr_t)0, NoIntrinsic },
170     { "classMethodWithOptional", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethodWithOptional), (intptr_t)1, NoIntrinsic },
171     { "classMethod2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod2), (intptr_t)1, NoIntrinsic },
172 #if ENABLE(Condition1)
173     { "overloadedMethod1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionOverloadedMethod1), (intptr_t)1, NoIntrinsic },
174 #endif
175     { 0, 0, 0, 0, NoIntrinsic }
176 };
177
178 static const HashTable JSTestObjConstructorTable = { 36, 31, JSTestObjConstructorTableValues, 0 };
179
180 #if ENABLE(Condition1)
181 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDoNotCheckConstants);
182 #endif
183 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDoNotCheckConstants);
184 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDoNotCheckConstants);
185 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDoNotCheckConstants);
186 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDoNotCheckConstants);
187 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDoNotCheckConstants);
188 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDoNotCheckConstants);
189 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDoNotCheckConstants);
190 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDoNotCheckConstants);
191 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDoNotCheckConstants);
192 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDoNotCheckConstants);
193 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDoNotCheckConstants);
194 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
195
196 const ClassInfo JSTestObjConstructor::s_info = { "TestObjectConstructor", &Base::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
197
198 JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
199     : DOMConstructorObject(structure, globalObject)
200 {
201 }
202
203 void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
204 {
205     Base::finishCreation(exec->globalData());
206     ASSERT(inherits(&s_info));
207     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
208     putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
209 }
210
211 bool JSTestObjConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
212 {
213     return getStaticPropertySlot<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, jsCast<JSTestObjConstructor*>(cell), propertyName, slot);
214 }
215
216 bool JSTestObjConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
217 {
218     return getStaticPropertyDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, jsCast<JSTestObjConstructor*>(object), propertyName, descriptor);
219 }
220
221 EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::constructJSTestObj(ExecState* exec)
222 {
223     JSTestObjConstructor* castedThis = jsCast<JSTestObjConstructor*>(exec->callee());
224     if (exec->argumentCount() < 1)
225         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
226     if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) {
227         setDOMException(exec, TYPE_MISMATCH_ERR);
228         return JSValue::encode(jsUndefined());
229     }
230     RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
231     RefPtr<TestObj> object = TestObj::create(testCallback);
232     return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
233 }
234
235 ConstructType JSTestObjConstructor::getConstructData(JSCell*, ConstructData& constructData)
236 {
237     constructData.native.function = constructJSTestObj;
238     return ConstructTypeHost;
239 }
240
241 /* Hash table for prototype */
242
243 static const HashTableValue JSTestObjPrototypeTableValues[] =
244 {
245 #if ENABLE(Condition1)
246     { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0, NoIntrinsic },
247 #endif
248     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0, NoIntrinsic },
249     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0, NoIntrinsic },
250     { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0, NoIntrinsic },
251     { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0, NoIntrinsic },
252     { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0, NoIntrinsic },
253     { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0, NoIntrinsic },
254     { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0, NoIntrinsic },
255     { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0, NoIntrinsic },
256     { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0, NoIntrinsic },
257     { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0, NoIntrinsic },
258     { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0, NoIntrinsic },
259     { "CONST_JAVASCRIPT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0, NoIntrinsic },
260     { "voidMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0, NoIntrinsic },
261     { "voidMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3, NoIntrinsic },
262     { "intMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0, NoIntrinsic },
263     { "intMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethodWithArgs), (intptr_t)3, NoIntrinsic },
264     { "objMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t)0, NoIntrinsic },
265     { "objMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t)3, NoIntrinsic },
266     { "methodWithSequenceArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t)1, NoIntrinsic },
267     { "methodReturningSequence", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodReturningSequence), (intptr_t)1, NoIntrinsic },
268     { "methodThatRequiresAllArgsAndThrows", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t)2, NoIntrinsic },
269     { "serializedValue", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1, NoIntrinsic },
270     { "idbKey", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIdbKey), (intptr_t)1, NoIntrinsic },
271     { "optionsObject", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t)2, NoIntrinsic },
272     { "methodWithException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0, NoIntrinsic },
273     { "customMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0, NoIntrinsic },
274     { "customMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3, NoIntrinsic },
275     { "addEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3, NoIntrinsic },
276     { "removeEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3, NoIntrinsic },
277     { "withScriptStateVoid", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0, NoIntrinsic },
278     { "withScriptStateObj", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0, NoIntrinsic },
279     { "withScriptStateVoidException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0, NoIntrinsic },
280     { "withScriptStateObjException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0, NoIntrinsic },
281     { "withScriptExecutionContext", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t)0, NoIntrinsic },
282     { "withScriptExecutionContextAndScriptState", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState), (intptr_t)0, NoIntrinsic },
283     { "withScriptExecutionContextAndScriptStateObjException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException), (intptr_t)0, NoIntrinsic },
284     { "withScriptExecutionContextAndScriptStateWithSpaces", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t)0, NoIntrinsic },
285     { "withScriptArgumentsAndCallStack", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t)0, NoIntrinsic },
286     { "methodWithOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1, NoIntrinsic },
287     { "methodWithNonOptionalArgAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2, NoIntrinsic },
288     { "methodWithNonOptionalArgAndTwoOptionalArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t)3, NoIntrinsic },
289     { "methodWithOptionalString", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalString), (intptr_t)1, NoIntrinsic },
290     { "methodWithOptionalStringIsUndefined", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined), (intptr_t)1, NoIntrinsic },
291     { "methodWithOptionalStringIsNullString", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString), (intptr_t)1, NoIntrinsic },
292     { "methodWithCallbackArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t)1, NoIntrinsic },
293     { "methodWithNonCallbackArgAndCallbackArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t)2, NoIntrinsic },
294     { "methodWithCallbackAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t)1, NoIntrinsic },
295 #if ENABLE(Condition1)
296     { "conditionalMethod1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod1), (intptr_t)0, NoIntrinsic },
297 #endif
298 #if ENABLE(Condition1) && ENABLE(Condition2)
299     { "conditionalMethod2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod2), (intptr_t)0, NoIntrinsic },
300 #endif
301 #if ENABLE(Condition1) || ENABLE(Condition2)
302     { "conditionalMethod3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t)0, NoIntrinsic },
303 #endif
304     { "overloadedMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2, NoIntrinsic },
305     { "methodWithUnsignedLongArray", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithUnsignedLongArray), (intptr_t)1, NoIntrinsic },
306     { "getSVGDocument", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t)0, NoIntrinsic },
307     { "convert1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t)1, NoIntrinsic },
308     { "convert2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t)1, NoIntrinsic },
309     { "convert3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t)1, NoIntrinsic },
310     { "convert4", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t)1, NoIntrinsic },
311     { "convert5", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t)1, NoIntrinsic },
312     { "mutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t)0, NoIntrinsic },
313     { "immutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t)0, NoIntrinsic },
314     { "orange", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t)0, NoIntrinsic },
315     { "strictFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunction), (intptr_t)3, NoIntrinsic },
316     { 0, 0, 0, 0, NoIntrinsic }
317 };
318
319 static const HashTable JSTestObjPrototypeTable = { 266, 255, JSTestObjPrototypeTableValues, 0 };
320 const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
321
322 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
323 {
324     return getDOMPrototype<JSTestObj>(exec, globalObject);
325 }
326
327 bool JSTestObjPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
328 {
329     JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(cell);
330     return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, slot);
331 }
332
333 bool JSTestObjPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
334 {
335     JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(object);
336     return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, descriptor);
337 }
338
339 const ClassInfo JSTestObj::s_info = { "TestObject", &Base::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) };
340
341 JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
342     : JSDOMWrapper(structure, globalObject)
343     , m_impl(impl.leakRef())
344 {
345 }
346
347 void JSTestObj::finishCreation(JSGlobalData& globalData)
348 {
349     Base::finishCreation(globalData);
350     ASSERT(inherits(&s_info));
351 }
352
353 JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
354 {
355     return JSTestObjPrototype::create(exec->globalData(), globalObject, JSTestObjPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
356 }
357
358 void JSTestObj::destroy(JSC::JSCell* cell)
359 {
360     JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
361     thisObject->JSTestObj::~JSTestObj();
362 }
363
364 JSTestObj::~JSTestObj()
365 {
366     releaseImplIfNotNull();
367 }
368
369 bool JSTestObj::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
370 {
371     JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
372     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
373     return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, slot);
374 }
375
376 bool JSTestObj::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
377 {
378     JSTestObj* thisObject = jsCast<JSTestObj*>(object);
379     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
380     return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, descriptor);
381 }
382
383 JSValue jsTestObjReadOnlyIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
384 {
385     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
386     UNUSED_PARAM(exec);
387     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
388     JSValue result = jsNumber(impl->readOnlyIntAttr());
389     return result;
390 }
391
392
393 JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
394 {
395     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
396     UNUSED_PARAM(exec);
397     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
398     JSValue result = jsString(exec, impl->readOnlyStringAttr());
399     return result;
400 }
401
402
403 JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
404 {
405     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
406     UNUSED_PARAM(exec);
407     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
408     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->readOnlyTestObjAttr()));
409     return result;
410 }
411
412
413 JSValue jsTestObjShortAttr(ExecState* exec, JSValue slotBase, const Identifier&)
414 {
415     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
416     UNUSED_PARAM(exec);
417     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
418     JSValue result = jsNumber(impl->shortAttr());
419     return result;
420 }
421
422
423 JSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSValue slotBase, const Identifier&)
424 {
425     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
426     UNUSED_PARAM(exec);
427     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
428     JSValue result = jsNumber(impl->unsignedShortAttr());
429     return result;
430 }
431
432
433 JSValue jsTestObjIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
434 {
435     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
436     UNUSED_PARAM(exec);
437     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
438     JSValue result = jsNumber(impl->intAttr());
439     return result;
440 }
441
442
443 JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
444 {
445     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
446     UNUSED_PARAM(exec);
447     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
448     JSValue result = jsNumber(impl->longLongAttr());
449     return result;
450 }
451
452
453 JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
454 {
455     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
456     UNUSED_PARAM(exec);
457     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
458     JSValue result = jsNumber(impl->unsignedLongLongAttr());
459     return result;
460 }
461
462
463 JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
464 {
465     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
466     UNUSED_PARAM(exec);
467     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
468     JSValue result = jsString(exec, impl->stringAttr());
469     return result;
470 }
471
472
473 JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
474 {
475     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
476     UNUSED_PARAM(exec);
477     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
478     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->testObjAttr()));
479     return result;
480 }
481
482
483 JSValue jsTestObjSequenceAttr(ExecState* exec, JSValue slotBase, const Identifier&)
484 {
485     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
486     UNUSED_PARAM(exec);
487     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
488     JSValue result = jsArray(exec, castedThis->globalObject(), impl->sequenceAttr());
489     return result;
490 }
491
492
493 JSValue jsTestObjXMLObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
494 {
495     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
496     UNUSED_PARAM(exec);
497     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
498     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->xmlObjAttr()));
499     return result;
500 }
501
502
503 JSValue jsTestObjCreate(ExecState* exec, JSValue slotBase, const Identifier&)
504 {
505     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
506     UNUSED_PARAM(exec);
507     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
508     JSValue result = jsBoolean(impl->isCreate());
509     return result;
510 }
511
512
513 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
514 {
515     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
516     UNUSED_PARAM(exec);
517     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
518     JSValue result = jsString(exec, impl->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
519     return result;
520 }
521
522
523 JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
524 {
525     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
526     UNUSED_PARAM(exec);
527     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
528     JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
529     return result;
530 }
531
532
533 JSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
534 {
535     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
536     UNUSED_PARAM(exec);
537     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
538     JSValue result = jsNumber(std::max(0, impl->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
539     return result;
540 }
541
542
543 JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
544 {
545     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
546     UNUSED_PARAM(exec);
547     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
548     JSValue result = jsBoolean(impl->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
549     return result;
550 }
551
552
553 JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
554 {
555     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
556     UNUSED_PARAM(exec);
557     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
558     JSValue result = jsString(exec, impl->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
559     return result;
560 }
561
562
563 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
564 {
565     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
566     UNUSED_PARAM(exec);
567     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
568     JSValue result = jsString(exec, impl->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
569     return result;
570 }
571
572
573 JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
574 {
575     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
576     UNUSED_PARAM(exec);
577     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
578     JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
579     return result;
580 }
581
582
583 JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
584 {
585     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
586     UNUSED_PARAM(exec);
587     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
588     JSValue result = jsBoolean(impl->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
589     return result;
590 }
591
592
593 JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
594 {
595     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
596     UNUSED_PARAM(exec);
597     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
598     JSValue result = jsString(exec, impl->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
599     return result;
600 }
601
602
603 JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
604 {
605     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
606     ExceptionCode ec = 0;
607     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
608     JSC::JSValue result = jsNumber(impl->attrWithGetterException(ec));
609     setDOMException(exec, ec);
610     return result;
611 }
612
613
614 JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
615 {
616     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
617     UNUSED_PARAM(exec);
618     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
619     JSValue result = jsNumber(impl->attrWithSetterException());
620     return result;
621 }
622
623
624 JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
625 {
626     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
627     ExceptionCode ec = 0;
628     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
629     JSC::JSValue result = jsString(exec, impl->stringAttrWithGetterException(ec));
630     setDOMException(exec, ec);
631     return result;
632 }
633
634
635 JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
636 {
637     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
638     UNUSED_PARAM(exec);
639     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
640     JSValue result = jsString(exec, impl->stringAttrWithSetterException());
641     return result;
642 }
643
644
645 JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier&)
646 {
647     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
648     return castedThis->customAttr(exec);
649 }
650
651
652 JSValue jsTestObjWithScriptStateAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
653 {
654     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
655     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
656     JSValue result = jsNumber(impl->withScriptStateAttribute(exec));
657     return result;
658 }
659
660
661 JSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
662 {
663     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
664     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
665     if (!scriptContext)
666         return jsUndefined();
667     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
668     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttribute(scriptContext)));
669     return result;
670 }
671
672
673 JSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
674 {
675     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
676     ExceptionCode ec = 0;
677     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
678     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateAttributeRaises(exec, ec)));
679     setDOMException(exec, ec);
680     return result;
681 }
682
683
684 JSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
685 {
686     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
687     ExceptionCode ec = 0;
688     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
689     if (!scriptContext)
690         return jsUndefined();
691     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
692     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttributeRaises(scriptContext, ec)));
693     setDOMException(exec, ec);
694     return result;
695 }
696
697
698 JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
699 {
700     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
701     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
702     if (!scriptContext)
703         return jsUndefined();
704     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
705     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext)));
706     return result;
707 }
708
709
710 JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
711 {
712     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
713     ExceptionCode ec = 0;
714     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
715     if (!scriptContext)
716         return jsUndefined();
717     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
718     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
719     setDOMException(exec, ec);
720     return result;
721 }
722
723
724 JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
725 {
726     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
727     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
728     if (!scriptContext)
729         return jsUndefined();
730     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
731     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext)));
732     return result;
733 }
734
735
736 JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
737 {
738     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
739     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));
740     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
741     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptArgumentsAndCallStackAttribute(callStack)));
742     return result;
743 }
744
745
746 #if ENABLE(Condition1)
747 JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
748 {
749     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
750     UNUSED_PARAM(exec);
751     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
752     JSValue result = jsNumber(impl->conditionalAttr1());
753     return result;
754 }
755
756 #endif
757
758 #if ENABLE(Condition1) && ENABLE(Condition2)
759 JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&)
760 {
761     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
762     UNUSED_PARAM(exec);
763     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
764     JSValue result = jsNumber(impl->conditionalAttr2());
765     return result;
766 }
767
768 #endif
769
770 #if ENABLE(Condition1) || ENABLE(Condition2)
771 JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&)
772 {
773     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
774     UNUSED_PARAM(exec);
775     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
776     JSValue result = jsNumber(impl->conditionalAttr3());
777     return result;
778 }
779
780 #endif
781
782 #if ENABLE(Condition1)
783 JSValue jsTestObjConditionalAttr4Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
784 {
785     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
786     return JSTestObjectA::getConstructor(exec, castedThis);
787 }
788
789 #endif
790
791 #if ENABLE(Condition1) && ENABLE(Condition2)
792 JSValue jsTestObjConditionalAttr5Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
793 {
794     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
795     return JSTestObjectB::getConstructor(exec, castedThis);
796 }
797
798 #endif
799
800 #if ENABLE(Condition1) || ENABLE(Condition2)
801 JSValue jsTestObjConditionalAttr6Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
802 {
803     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
804     return JSTestObjectC::getConstructor(exec, castedThis);
805 }
806
807 #endif
808
809 JSValue jsTestObjCachedAttribute1(ExecState* exec, JSValue slotBase, const Identifier&)
810 {
811     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
812     UNUSED_PARAM(exec);
813     if (JSValue cachedValue = castedThis->m_cachedAttribute1.get())
814         return cachedValue;
815     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
816     JSValue result = impl->cachedAttribute1() ? impl->cachedAttribute1()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
817     castedThis->m_cachedAttribute1.set(exec->globalData(), castedThis, result);
818     return result;
819 }
820
821
822 JSValue jsTestObjCachedAttribute2(ExecState* exec, JSValue slotBase, const Identifier&)
823 {
824     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
825     UNUSED_PARAM(exec);
826     if (JSValue cachedValue = castedThis->m_cachedAttribute2.get())
827         return cachedValue;
828     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
829     JSValue result = impl->cachedAttribute2() ? impl->cachedAttribute2()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
830     castedThis->m_cachedAttribute2.set(exec->globalData(), castedThis, result);
831     return result;
832 }
833
834
835 JSValue jsTestObjContentDocument(ExecState* exec, JSValue slotBase, const Identifier&)
836 {
837     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
838     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
839     return shouldAllowAccessToNode(exec, impl->contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->contentDocument())) : jsNull();
840 }
841
842
843 JSValue jsTestObjMutablePoint(ExecState* exec, JSValue slotBase, const Identifier&)
844 {
845     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
846     UNUSED_PARAM(exec);
847     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
848     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::create(impl, impl->mutablePoint(), &TestObj::updateMutablePoint)));
849     return result;
850 }
851
852
853 JSValue jsTestObjImmutablePoint(ExecState* exec, JSValue slotBase, const Identifier&)
854 {
855     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
856     UNUSED_PARAM(exec);
857     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
858     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->immutablePoint())));
859     return result;
860 }
861
862
863 JSValue jsTestObjStrawberry(ExecState* exec, JSValue slotBase, const Identifier&)
864 {
865     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
866     UNUSED_PARAM(exec);
867     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
868     JSValue result = jsNumber(impl->blueberry());
869     return result;
870 }
871
872
873 JSValue jsTestObjStrictFloat(ExecState* exec, JSValue slotBase, const Identifier&)
874 {
875     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
876     UNUSED_PARAM(exec);
877     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
878     JSValue result = jsNumber(impl->strictFloat());
879     return result;
880 }
881
882
883 JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
884 {
885     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
886     UNUSED_PARAM(exec);
887     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
888     JSValue result = jsNumber(impl->description());
889     return result;
890 }
891
892
893 JSValue jsTestObjId(ExecState* exec, JSValue slotBase, const Identifier&)
894 {
895     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
896     UNUSED_PARAM(exec);
897     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
898     JSValue result = jsNumber(impl->id());
899     return result;
900 }
901
902
903 JSValue jsTestObjHash(ExecState* exec, JSValue slotBase, const Identifier&)
904 {
905     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
906     UNUSED_PARAM(exec);
907     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
908     JSValue result = jsString(exec, impl->hash());
909     return result;
910 }
911
912
913 JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
914 {
915     JSTestObj* domObject = jsCast<JSTestObj*>(asObject(slotBase));
916     return JSTestObj::getConstructor(exec, domObject->globalObject());
917 }
918
919 void JSTestObj::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
920 {
921     JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
922     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
923     lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, thisObject, slot);
924 }
925
926 void setJSTestObjShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
927 {
928     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
929     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
930     impl->setShortAttr(value.toInt32(exec));
931 }
932
933
934 void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
935 {
936     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
937     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
938     impl->setUnsignedShortAttr(value.toUInt32(exec));
939 }
940
941
942 void setJSTestObjIntAttr(ExecState* exec, JSObject* thisObject, JSValue value)
943 {
944     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
945     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
946     impl->setIntAttr(value.toInt32(exec));
947 }
948
949
950 void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
951 {
952     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
953     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
954     impl->setLongLongAttr(static_cast<long long>(value.toInteger(exec)));
955 }
956
957
958 void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
959 {
960     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
961     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
962     impl->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec)));
963 }
964
965
966 void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
967 {
968     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
969     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
970     impl->setStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
971 }
972
973
974 void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
975 {
976     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
977     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
978     impl->setTestObjAttr(toTestObj(value));
979 }
980
981
982 void setJSTestObjSequenceAttr(ExecState* exec, JSObject* thisObject, JSValue value)
983 {
984     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
985     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
986     impl->setSequenceAttr(toNativeArray<ScriptProfile>(exec, value));
987 }
988
989
990 void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
991 {
992     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
993     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
994     impl->setXMLObjAttr(toTestObj(value));
995 }
996
997
998 void setJSTestObjCreate(ExecState* exec, JSObject* thisObject, JSValue value)
999 {
1000     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1001     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1002     impl->setCreate(value.toBoolean(exec));
1003 }
1004
1005
1006 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1007 {
1008     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1009     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1010     impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
1011 }
1012
1013
1014 void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1015 {
1016     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1017     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1018     impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec));
1019 }
1020
1021
1022 void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1023 {
1024     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1025     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1026     impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, value.toUInt32(exec));
1027 }
1028
1029
1030 void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1031 {
1032     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1033     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1034     impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
1035 }
1036
1037
1038 void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1039 {
1040     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1041     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1042     impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
1043 }
1044
1045
1046 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1047 {
1048     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1049     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1050     impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
1051 }
1052
1053
1054 void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1055 {
1056     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1057     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1058     impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec));
1059 }
1060
1061
1062 void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1063 {
1064     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1065     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1066     impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
1067 }
1068
1069
1070 void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1071 {
1072     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1073     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1074     impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
1075 }
1076
1077
1078 void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
1079 {
1080     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1081     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1082     ExceptionCode ec = 0;
1083     impl->setAttrWithGetterException(value.toInt32(exec), ec);
1084     setDOMException(exec, ec);
1085 }
1086
1087
1088 void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
1089 {
1090     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1091     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1092     ExceptionCode ec = 0;
1093     impl->setAttrWithSetterException(value.toInt32(exec), ec);
1094     setDOMException(exec, ec);
1095 }
1096
1097
1098 void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
1099 {
1100     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1101     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1102     ExceptionCode ec = 0;
1103     impl->setStringAttrWithGetterException(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)), ec);
1104     setDOMException(exec, ec);
1105 }
1106
1107
1108 void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
1109 {
1110     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1111     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1112     ExceptionCode ec = 0;
1113     impl->setStringAttrWithSetterException(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)), ec);
1114     setDOMException(exec, ec);
1115 }
1116
1117
1118 void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1119 {
1120     jsCast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
1121 }
1122
1123
1124 void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1125 {
1126     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1127     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1128     impl->setWithScriptStateAttribute(exec, value.toInt32(exec));
1129 }
1130
1131
1132 void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1133 {
1134     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1135     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1136     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1137     if (!scriptContext)
1138         return;
1139     impl->setWithScriptExecutionContextAttribute(scriptContext, toTestObj(value));
1140 }
1141
1142
1143 void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
1144 {
1145     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1146     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1147     ExceptionCode ec = 0;
1148     impl->setWithScriptStateAttributeRaises(exec, toTestObj(value), ec);
1149     setDOMException(exec, ec);
1150 }
1151
1152
1153 void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
1154 {
1155     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1156     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1157     ExceptionCode ec = 0;
1158     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1159     if (!scriptContext)
1160         return;
1161     impl->setWithScriptExecutionContextAttributeRaises(scriptContext, toTestObj(value), ec);
1162     setDOMException(exec, ec);
1163 }
1164
1165
1166 void setJSTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1167 {
1168     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1169     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1170     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1171     if (!scriptContext)
1172         return;
1173     impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, toTestObj(value));
1174 }
1175
1176
1177 void setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
1178 {
1179     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1180     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1181     ExceptionCode ec = 0;
1182     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1183     if (!scriptContext)
1184         return;
1185     impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, toTestObj(value), ec);
1186     setDOMException(exec, ec);
1187 }
1188
1189
1190 void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1191 {
1192     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1193     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1194     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1195     if (!scriptContext)
1196         return;
1197     impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, toTestObj(value));
1198 }
1199
1200
1201 void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1202 {
1203     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1204     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1205     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));
1206     impl->setWithScriptArgumentsAndCallStackAttribute(callStack, toTestObj(value));
1207 }
1208
1209
1210 #if ENABLE(Condition1)
1211 void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
1212 {
1213     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1214     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1215     impl->setConditionalAttr1(value.toInt32(exec));
1216 }
1217
1218 #endif
1219
1220 #if ENABLE(Condition1) && ENABLE(Condition2)
1221 void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value)
1222 {
1223     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1224     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1225     impl->setConditionalAttr2(value.toInt32(exec));
1226 }
1227
1228 #endif
1229
1230 #if ENABLE(Condition1) || ENABLE(Condition2)
1231 void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value)
1232 {
1233     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1234     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1235     impl->setConditionalAttr3(value.toInt32(exec));
1236 }
1237
1238 #endif
1239
1240 #if ENABLE(Condition1)
1241 void setJSTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1242 {
1243     // Shadowing a built-in constructor
1244     jsCast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr4"), value);
1245 }
1246
1247 #endif
1248
1249 #if ENABLE(Condition1) && ENABLE(Condition2)
1250 void setJSTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1251 {
1252     // Shadowing a built-in constructor
1253     jsCast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr5"), value);
1254 }
1255
1256 #endif
1257
1258 #if ENABLE(Condition1) || ENABLE(Condition2)
1259 void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1260 {
1261     // Shadowing a built-in constructor
1262     jsCast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr6"), value);
1263 }
1264
1265 #endif
1266
1267 void setJSTestObjMutablePoint(ExecState* exec, JSObject* thisObject, JSValue value)
1268 {
1269     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1270     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1271     impl->setMutablePoint(toSVGPoint(value));
1272 }
1273
1274
1275 void setJSTestObjImmutablePoint(ExecState* exec, JSObject* thisObject, JSValue value)
1276 {
1277     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1278     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1279     impl->setImmutablePoint(toSVGPoint(value));
1280 }
1281
1282
1283 void setJSTestObjStrawberry(ExecState* exec, JSObject* thisObject, JSValue value)
1284 {
1285     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1286     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1287     impl->setBlueberry(toint(value));
1288 }
1289
1290
1291 void setJSTestObjStrictFloat(ExecState* exec, JSObject* thisObject, JSValue value)
1292 {
1293     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1294     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1295     impl->setStrictFloat(value.toFloat(exec));
1296 }
1297
1298
1299 void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
1300 {
1301     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
1302     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1303     impl->setId(value.toInt32(exec));
1304 }
1305
1306
1307 JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
1308 {
1309     return getDOMConstructor<JSTestObjConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
1310 }
1311
1312 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec)
1313 {
1314     JSValue thisValue = exec->hostThisValue();
1315     if (!thisValue.inherits(&JSTestObj::s_info))
1316         return throwVMTypeError(exec);
1317     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1318     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1319     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1320     impl->voidMethod();
1321     return JSValue::encode(jsUndefined());
1322 }
1323
1324 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec)
1325 {
1326     JSValue thisValue = exec->hostThisValue();
1327     if (!thisValue.inherits(&JSTestObj::s_info))
1328         return throwVMTypeError(exec);
1329     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1330     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1331     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1332     if (exec->argumentCount() < 3)
1333         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1334     int intArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1335     if (exec->hadException())
1336         return JSValue::encode(jsUndefined());
1337     const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
1338     if (exec->hadException())
1339         return JSValue::encode(jsUndefined());
1340     TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
1341     if (exec->hadException())
1342         return JSValue::encode(jsUndefined());
1343     impl->voidMethodWithArgs(intArg, strArg, objArg);
1344     return JSValue::encode(jsUndefined());
1345 }
1346
1347 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec)
1348 {
1349     JSValue thisValue = exec->hostThisValue();
1350     if (!thisValue.inherits(&JSTestObj::s_info))
1351         return throwVMTypeError(exec);
1352     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1353     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1354     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1355
1356     JSC::JSValue result = jsNumber(impl->intMethod());
1357     return JSValue::encode(result);
1358 }
1359
1360 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecState* exec)
1361 {
1362     JSValue thisValue = exec->hostThisValue();
1363     if (!thisValue.inherits(&JSTestObj::s_info))
1364         return throwVMTypeError(exec);
1365     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1366     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1367     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1368     if (exec->argumentCount() < 3)
1369         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1370     int intArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1371     if (exec->hadException())
1372         return JSValue::encode(jsUndefined());
1373     const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
1374     if (exec->hadException())
1375         return JSValue::encode(jsUndefined());
1376     TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
1377     if (exec->hadException())
1378         return JSValue::encode(jsUndefined());
1379
1380     JSC::JSValue result = jsNumber(impl->intMethodWithArgs(intArg, strArg, objArg));
1381     return JSValue::encode(result);
1382 }
1383
1384 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec)
1385 {
1386     JSValue thisValue = exec->hostThisValue();
1387     if (!thisValue.inherits(&JSTestObj::s_info))
1388         return throwVMTypeError(exec);
1389     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1390     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1391     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1392
1393     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->objMethod()));
1394     return JSValue::encode(result);
1395 }
1396
1397 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec)
1398 {
1399     JSValue thisValue = exec->hostThisValue();
1400     if (!thisValue.inherits(&JSTestObj::s_info))
1401         return throwVMTypeError(exec);
1402     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1403     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1404     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1405     if (exec->argumentCount() < 3)
1406         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1407     int intArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1408     if (exec->hadException())
1409         return JSValue::encode(jsUndefined());
1410     const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
1411     if (exec->hadException())
1412         return JSValue::encode(jsUndefined());
1413     TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
1414     if (exec->hadException())
1415         return JSValue::encode(jsUndefined());
1416
1417     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->objMethodWithArgs(intArg, strArg, objArg)));
1418     return JSValue::encode(result);
1419 }
1420
1421 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(ExecState* exec)
1422 {
1423     JSValue thisValue = exec->hostThisValue();
1424     if (!thisValue.inherits(&JSTestObj::s_info))
1425         return throwVMTypeError(exec);
1426     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1427     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1428     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1429     if (exec->argumentCount() < 1)
1430         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1431     sequence<ScriptProfile>* sequenceArg(toNativeArray<ScriptProfile>(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
1432     if (exec->hadException())
1433         return JSValue::encode(jsUndefined());
1434     impl->methodWithSequenceArg(sequenceArg);
1435     return JSValue::encode(jsUndefined());
1436 }
1437
1438 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(ExecState* exec)
1439 {
1440     JSValue thisValue = exec->hostThisValue();
1441     if (!thisValue.inherits(&JSTestObj::s_info))
1442         return throwVMTypeError(exec);
1443     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1444     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1445     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1446     if (exec->argumentCount() < 1)
1447         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1448     int intArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1449     if (exec->hadException())
1450         return JSValue::encode(jsUndefined());
1451
1452     JSC::JSValue result = jsArray(exec, castedThis->globalObject(), impl->methodReturningSequence(intArg));
1453     return JSValue::encode(result);
1454 }
1455
1456 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec)
1457 {
1458     JSValue thisValue = exec->hostThisValue();
1459     if (!thisValue.inherits(&JSTestObj::s_info))
1460         return throwVMTypeError(exec);
1461     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1462     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1463     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1464     if (exec->argumentCount() < 2)
1465         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1466     ExceptionCode ec = 0;
1467     const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
1468     if (exec->hadException())
1469         return JSValue::encode(jsUndefined());
1470     TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
1471     if (exec->hadException())
1472         return JSValue::encode(jsUndefined());
1473
1474     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
1475     setDOMException(exec, ec);
1476     return JSValue::encode(result);
1477 }
1478
1479 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec)
1480 {
1481     JSValue thisValue = exec->hostThisValue();
1482     if (!thisValue.inherits(&JSTestObj::s_info))
1483         return throwVMTypeError(exec);
1484     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1485     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1486     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1487     if (exec->argumentCount() < 1)
1488         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1489     RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
1490     if (exec->hadException())
1491         return JSValue::encode(jsUndefined());
1492     impl->serializedValue(serializedArg);
1493     return JSValue::encode(jsUndefined());
1494 }
1495
1496 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec)
1497 {
1498     JSValue thisValue = exec->hostThisValue();
1499     if (!thisValue.inherits(&JSTestObj::s_info))
1500         return throwVMTypeError(exec);
1501     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1502     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1503     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1504     if (exec->argumentCount() < 1)
1505         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1506     PassRefPtr<IDBKey> key(createIDBKeyFromValue(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
1507     if (exec->hadException())
1508         return JSValue::encode(jsUndefined());
1509     impl->idbKey(key);
1510     return JSValue::encode(jsUndefined());
1511 }
1512
1513 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec)
1514 {
1515     JSValue thisValue = exec->hostThisValue();
1516     if (!thisValue.inherits(&JSTestObj::s_info))
1517         return throwVMTypeError(exec);
1518     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1519     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1520     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1521     if (exec->argumentCount() < 1)
1522         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1523     Dictionary oo(createDictionaryFromValue(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
1524     if (exec->hadException())
1525         return JSValue::encode(jsUndefined());
1526
1527     size_t argsCount = exec->argumentCount();
1528     if (argsCount <= 1) {
1529         impl->optionsObject(oo);
1530         return JSValue::encode(jsUndefined());
1531     }
1532
1533     Dictionary ooo(createDictionaryFromValue(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
1534     if (exec->hadException())
1535         return JSValue::encode(jsUndefined());
1536     impl->optionsObject(oo, ooo);
1537     return JSValue::encode(jsUndefined());
1538 }
1539
1540 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec)
1541 {
1542     JSValue thisValue = exec->hostThisValue();
1543     if (!thisValue.inherits(&JSTestObj::s_info))
1544         return throwVMTypeError(exec);
1545     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1546     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1547     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1548     ExceptionCode ec = 0;
1549     impl->methodWithException(ec);
1550     setDOMException(exec, ec);
1551     return JSValue::encode(jsUndefined());
1552 }
1553
1554 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec)
1555 {
1556     JSValue thisValue = exec->hostThisValue();
1557     if (!thisValue.inherits(&JSTestObj::s_info))
1558         return throwVMTypeError(exec);
1559     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1560     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1561     return JSValue::encode(castedThis->customMethod(exec));
1562 }
1563
1564 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec)
1565 {
1566     JSValue thisValue = exec->hostThisValue();
1567     if (!thisValue.inherits(&JSTestObj::s_info))
1568         return throwVMTypeError(exec);
1569     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1570     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1571     return JSValue::encode(castedThis->customMethodWithArgs(exec));
1572 }
1573
1574 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec)
1575 {
1576     JSValue thisValue = exec->hostThisValue();
1577     if (!thisValue.inherits(&JSTestObj::s_info))
1578         return throwVMTypeError(exec);
1579     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1580     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1581     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1582     if (exec->argumentCount() < 2)
1583         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1584     JSValue listener = exec->argument(1);
1585     if (!listener.isObject())
1586         return JSValue::encode(jsUndefined());
1587     impl->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
1588     return JSValue::encode(jsUndefined());
1589 }
1590
1591 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec)
1592 {
1593     JSValue thisValue = exec->hostThisValue();
1594     if (!thisValue.inherits(&JSTestObj::s_info))
1595         return throwVMTypeError(exec);
1596     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1597     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1598     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1599     if (exec->argumentCount() < 2)
1600         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1601     JSValue listener = exec->argument(1);
1602     if (!listener.isObject())
1603         return JSValue::encode(jsUndefined());
1604     impl->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
1605     return JSValue::encode(jsUndefined());
1606 }
1607
1608 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec)
1609 {
1610     JSValue thisValue = exec->hostThisValue();
1611     if (!thisValue.inherits(&JSTestObj::s_info))
1612         return throwVMTypeError(exec);
1613     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1614     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1615     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1616     impl->withScriptStateVoid(exec);
1617     return JSValue::encode(jsUndefined());
1618 }
1619
1620 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec)
1621 {
1622     JSValue thisValue = exec->hostThisValue();
1623     if (!thisValue.inherits(&JSTestObj::s_info))
1624         return throwVMTypeError(exec);
1625     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1626     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1627     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1628
1629     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateObj(exec)));
1630     if (exec->hadException())
1631         return JSValue::encode(jsUndefined());
1632     return JSValue::encode(result);
1633 }
1634
1635 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec)
1636 {
1637     JSValue thisValue = exec->hostThisValue();
1638     if (!thisValue.inherits(&JSTestObj::s_info))
1639         return throwVMTypeError(exec);
1640     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1641     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1642     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1643     ExceptionCode ec = 0;
1644     impl->withScriptStateVoidException(exec, ec);
1645     setDOMException(exec, ec);
1646     return JSValue::encode(jsUndefined());
1647 }
1648
1649 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec)
1650 {
1651     JSValue thisValue = exec->hostThisValue();
1652     if (!thisValue.inherits(&JSTestObj::s_info))
1653         return throwVMTypeError(exec);
1654     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1655     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1656     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1657     ExceptionCode ec = 0;
1658
1659     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateObjException(exec, ec)));
1660     setDOMException(exec, ec);
1661     if (exec->hadException())
1662         return JSValue::encode(jsUndefined());
1663     return JSValue::encode(result);
1664 }
1665
1666 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
1667 {
1668     JSValue thisValue = exec->hostThisValue();
1669     if (!thisValue.inherits(&JSTestObj::s_info))
1670         return throwVMTypeError(exec);
1671     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1672     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1673     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1674     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1675     if (!scriptContext)
1676         return JSValue::encode(jsUndefined());
1677     impl->withScriptExecutionContext(scriptContext);
1678     return JSValue::encode(jsUndefined());
1679 }
1680
1681 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState(ExecState* exec)
1682 {
1683     JSValue thisValue = exec->hostThisValue();
1684     if (!thisValue.inherits(&JSTestObj::s_info))
1685         return throwVMTypeError(exec);
1686     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1687     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1688     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1689     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1690     if (!scriptContext)
1691         return JSValue::encode(jsUndefined());
1692     impl->withScriptExecutionContextAndScriptState(exec, scriptContext);
1693     return JSValue::encode(jsUndefined());
1694 }
1695
1696 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException(ExecState* exec)
1697 {
1698     JSValue thisValue = exec->hostThisValue();
1699     if (!thisValue.inherits(&JSTestObj::s_info))
1700         return throwVMTypeError(exec);
1701     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1702     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1703     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1704     ExceptionCode ec = 0;
1705     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1706     if (!scriptContext)
1707         return JSValue::encode(jsUndefined());
1708
1709     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateObjException(exec, scriptContext, ec)));
1710     setDOMException(exec, ec);
1711     if (exec->hadException())
1712         return JSValue::encode(jsUndefined());
1713     return JSValue::encode(result);
1714 }
1715
1716 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(ExecState* exec)
1717 {
1718     JSValue thisValue = exec->hostThisValue();
1719     if (!thisValue.inherits(&JSTestObj::s_info))
1720         return throwVMTypeError(exec);
1721     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1722     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1723     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1724     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1725     if (!scriptContext)
1726         return JSValue::encode(jsUndefined());
1727
1728     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpaces(exec, scriptContext)));
1729     if (exec->hadException())
1730         return JSValue::encode(jsUndefined());
1731     return JSValue::encode(result);
1732 }
1733
1734 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(ExecState* exec)
1735 {
1736     JSValue thisValue = exec->hostThisValue();
1737     if (!thisValue.inherits(&JSTestObj::s_info))
1738         return throwVMTypeError(exec);
1739     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1740     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1741     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1742     RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0));
1743     RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));
1744     impl->withScriptArgumentsAndCallStack(scriptArguments, callStack);
1745     return JSValue::encode(jsUndefined());
1746 }
1747
1748 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec)
1749 {
1750     JSValue thisValue = exec->hostThisValue();
1751     if (!thisValue.inherits(&JSTestObj::s_info))
1752         return throwVMTypeError(exec);
1753     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1754     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1755     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1756
1757     size_t argsCount = exec->argumentCount();
1758     if (argsCount <= 0) {
1759         impl->methodWithOptionalArg();
1760         return JSValue::encode(jsUndefined());
1761     }
1762
1763     int opt(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1764     if (exec->hadException())
1765         return JSValue::encode(jsUndefined());
1766     impl->methodWithOptionalArg(opt);
1767     return JSValue::encode(jsUndefined());
1768 }
1769
1770 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec)
1771 {
1772     JSValue thisValue = exec->hostThisValue();
1773     if (!thisValue.inherits(&JSTestObj::s_info))
1774         return throwVMTypeError(exec);
1775     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1776     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1777     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1778     if (exec->argumentCount() < 1)
1779         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1780     int nonOpt(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1781     if (exec->hadException())
1782         return JSValue::encode(jsUndefined());
1783
1784     size_t argsCount = exec->argumentCount();
1785     if (argsCount <= 1) {
1786         impl->methodWithNonOptionalArgAndOptionalArg(nonOpt);
1787         return JSValue::encode(jsUndefined());
1788     }
1789
1790     int opt(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toInt32(exec));
1791     if (exec->hadException())
1792         return JSValue::encode(jsUndefined());
1793     impl->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
1794     return JSValue::encode(jsUndefined());
1795 }
1796
1797 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec)
1798 {
1799     JSValue thisValue = exec->hostThisValue();
1800     if (!thisValue.inherits(&JSTestObj::s_info))
1801         return throwVMTypeError(exec);
1802     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1803     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1804     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1805     if (exec->argumentCount() < 1)
1806         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1807     int nonOpt(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1808     if (exec->hadException())
1809         return JSValue::encode(jsUndefined());
1810
1811     size_t argsCount = exec->argumentCount();
1812     if (argsCount <= 1) {
1813         impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
1814         return JSValue::encode(jsUndefined());
1815     }
1816
1817     int opt1(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toInt32(exec));
1818     if (exec->hadException())
1819         return JSValue::encode(jsUndefined());
1820     if (argsCount <= 2) {
1821         impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
1822         return JSValue::encode(jsUndefined());
1823     }
1824
1825     int opt2(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined).toInt32(exec));
1826     if (exec->hadException())
1827         return JSValue::encode(jsUndefined());
1828     impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
1829     return JSValue::encode(jsUndefined());
1830 }
1831
1832 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(ExecState* exec)
1833 {
1834     JSValue thisValue = exec->hostThisValue();
1835     if (!thisValue.inherits(&JSTestObj::s_info))
1836         return throwVMTypeError(exec);
1837     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1838     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1839     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1840
1841     size_t argsCount = exec->argumentCount();
1842     if (argsCount <= 0) {
1843         impl->methodWithOptionalString();
1844         return JSValue::encode(jsUndefined());
1845     }
1846
1847     const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
1848     if (exec->hadException())
1849         return JSValue::encode(jsUndefined());
1850     impl->methodWithOptionalString(str);
1851     return JSValue::encode(jsUndefined());
1852 }
1853
1854 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(ExecState* exec)
1855 {
1856     JSValue thisValue = exec->hostThisValue();
1857     if (!thisValue.inherits(&JSTestObj::s_info))
1858         return throwVMTypeError(exec);
1859     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1860     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1861     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1862     const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
1863     if (exec->hadException())
1864         return JSValue::encode(jsUndefined());
1865     impl->methodWithOptionalStringIsUndefined(str);
1866     return JSValue::encode(jsUndefined());
1867 }
1868
1869 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString(ExecState* exec)
1870 {
1871     JSValue thisValue = exec->hostThisValue();
1872     if (!thisValue.inherits(&JSTestObj::s_info))
1873         return throwVMTypeError(exec);
1874     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1875     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1876     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1877     const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsNullString).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsNullString).toString(exec)->value(exec)));
1878     if (exec->hadException())
1879         return JSValue::encode(jsUndefined());
1880     impl->methodWithOptionalStringIsNullString(str);
1881     return JSValue::encode(jsUndefined());
1882 }
1883
1884 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* exec)
1885 {
1886     JSValue thisValue = exec->hostThisValue();
1887     if (!thisValue.inherits(&JSTestObj::s_info))
1888         return throwVMTypeError(exec);
1889     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1890     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1891     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1892     if (exec->argumentCount() < 1)
1893         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1894     if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) {
1895         setDOMException(exec, TYPE_MISMATCH_ERR);
1896         return JSValue::encode(jsUndefined());
1897     }
1898     RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1899     impl->methodWithCallbackArg(callback);
1900     return JSValue::encode(jsUndefined());
1901 }
1902
1903 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec)
1904 {
1905     JSValue thisValue = exec->hostThisValue();
1906     if (!thisValue.inherits(&JSTestObj::s_info))
1907         return throwVMTypeError(exec);
1908     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1909     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1910     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1911     if (exec->argumentCount() < 2)
1912         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
1913     int nonCallback(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
1914     if (exec->hadException())
1915         return JSValue::encode(jsUndefined());
1916     if (exec->argumentCount() <= 1 || !exec->argument(1).isFunction()) {
1917         setDOMException(exec, TYPE_MISMATCH_ERR);
1918         return JSValue::encode(jsUndefined());
1919     }
1920     RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject());
1921     impl->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
1922     return JSValue::encode(jsUndefined());
1923 }
1924
1925 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec)
1926 {
1927     JSValue thisValue = exec->hostThisValue();
1928     if (!thisValue.inherits(&JSTestObj::s_info))
1929         return throwVMTypeError(exec);
1930     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1931     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1932     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1933     RefPtr<TestCallback> callback;
1934     if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull()) {
1935         if (!exec->argument(0).isFunction()) {
1936             setDOMException(exec, TYPE_MISMATCH_ERR);
1937             return JSValue::encode(jsUndefined());
1938         }
1939         callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1940     }
1941     impl->methodWithCallbackAndOptionalArg(callback);
1942     return JSValue::encode(jsUndefined());
1943 }
1944
1945 #if ENABLE(Condition1)
1946 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod1(ExecState* exec)
1947 {
1948     JSValue thisValue = exec->hostThisValue();
1949     if (!thisValue.inherits(&JSTestObj::s_info))
1950         return throwVMTypeError(exec);
1951     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1952     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1953     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1954
1955     JSC::JSValue result = jsString(exec, impl->conditionalMethod1());
1956     return JSValue::encode(result);
1957 }
1958
1959 #endif
1960
1961 #if ENABLE(Condition1) && ENABLE(Condition2)
1962 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod2(ExecState* exec)
1963 {
1964     JSValue thisValue = exec->hostThisValue();
1965     if (!thisValue.inherits(&JSTestObj::s_info))
1966         return throwVMTypeError(exec);
1967     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1968     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1969     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1970     impl->conditionalMethod2();
1971     return JSValue::encode(jsUndefined());
1972 }
1973
1974 #endif
1975
1976 #if ENABLE(Condition1) || ENABLE(Condition2)
1977 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod3(ExecState* exec)
1978 {
1979     JSValue thisValue = exec->hostThisValue();
1980     if (!thisValue.inherits(&JSTestObj::s_info))
1981         return throwVMTypeError(exec);
1982     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1983     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1984     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1985     impl->conditionalMethod3();
1986     return JSValue::encode(jsUndefined());
1987 }
1988
1989 #endif
1990
1991 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
1992 {
1993     JSValue thisValue = exec->hostThisValue();
1994     if (!thisValue.inherits(&JSTestObj::s_info))
1995         return throwVMTypeError(exec);
1996     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
1997     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
1998     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1999     if (exec->argumentCount() < 2)
2000         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2001     TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2002     if (exec->hadException())
2003         return JSValue::encode(jsUndefined());
2004     const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
2005     if (exec->hadException())
2006         return JSValue::encode(jsUndefined());
2007     impl->overloadedMethod(objArg, strArg);
2008     return JSValue::encode(jsUndefined());
2009 }
2010
2011 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
2012 {
2013     JSValue thisValue = exec->hostThisValue();
2014     if (!thisValue.inherits(&JSTestObj::s_info))
2015         return throwVMTypeError(exec);
2016     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2017     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2018     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2019     if (exec->argumentCount() < 1)
2020         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2021     TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2022     if (exec->hadException())
2023         return JSValue::encode(jsUndefined());
2024
2025     size_t argsCount = exec->argumentCount();
2026     if (argsCount <= 1) {
2027         impl->overloadedMethod(objArg);
2028         return JSValue::encode(jsUndefined());
2029     }
2030
2031     int intArg(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toInt32(exec));
2032     if (exec->hadException())
2033         return JSValue::encode(jsUndefined());
2034     impl->overloadedMethod(objArg, intArg);
2035     return JSValue::encode(jsUndefined());
2036 }
2037
2038 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
2039 {
2040     JSValue thisValue = exec->hostThisValue();
2041     if (!thisValue.inherits(&JSTestObj::s_info))
2042         return throwVMTypeError(exec);
2043     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2044     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2045     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2046     if (exec->argumentCount() < 1)
2047         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2048     const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
2049     if (exec->hadException())
2050         return JSValue::encode(jsUndefined());
2051     impl->overloadedMethod(strArg);
2052     return JSValue::encode(jsUndefined());
2053 }
2054
2055 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
2056 {
2057     JSValue thisValue = exec->hostThisValue();
2058     if (!thisValue.inherits(&JSTestObj::s_info))
2059         return throwVMTypeError(exec);
2060     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2061     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2062     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2063     if (exec->argumentCount() < 1)
2064         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2065     int intArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
2066     if (exec->hadException())
2067         return JSValue::encode(jsUndefined());
2068     impl->overloadedMethod(intArg);
2069     return JSValue::encode(jsUndefined());
2070 }
2071
2072 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod5(ExecState* exec)
2073 {
2074     JSValue thisValue = exec->hostThisValue();
2075     if (!thisValue.inherits(&JSTestObj::s_info))
2076         return throwVMTypeError(exec);
2077     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2078     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2079     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2080     if (exec->argumentCount() < 1)
2081         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2082     if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) {
2083         setDOMException(exec, TYPE_MISMATCH_ERR);
2084         return JSValue::encode(jsUndefined());
2085     }
2086     RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
2087     impl->overloadedMethod(callback);
2088     return JSValue::encode(jsUndefined());
2089 }
2090
2091 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod6(ExecState* exec)
2092 {
2093     JSValue thisValue = exec->hostThisValue();
2094     if (!thisValue.inherits(&JSTestObj::s_info))
2095         return throwVMTypeError(exec);
2096     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2097     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2098     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2099     if (exec->argumentCount() < 1)
2100         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2101     DOMStringList* listArg(toDOMStringList(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2102     if (exec->hadException())
2103         return JSValue::encode(jsUndefined());
2104     impl->overloadedMethod(listArg);
2105     return JSValue::encode(jsUndefined());
2106 }
2107
2108 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod7(ExecState* exec)
2109 {
2110     JSValue thisValue = exec->hostThisValue();
2111     if (!thisValue.inherits(&JSTestObj::s_info))
2112         return throwVMTypeError(exec);
2113     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2114     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2115     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2116     if (exec->argumentCount() < 1)
2117         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2118     DOMStringList* arrayArg(toDOMStringList(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2119     if (exec->hadException())
2120         return JSValue::encode(jsUndefined());
2121     impl->overloadedMethod(arrayArg);
2122     return JSValue::encode(jsUndefined());
2123 }
2124
2125 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
2126 {
2127     size_t argsCount = exec->argumentCount();
2128     JSValue arg1(exec->argument(1));
2129     JSValue arg0(exec->argument(0));
2130     if ((argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info))) && (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject())))
2131         return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
2132     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)))))
2133         return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
2134     if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))
2135         return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
2136     if (argsCount == 1)
2137         return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
2138     if ((argsCount == 1 && (arg0.isNull() || arg0.isFunction())))
2139         return jsTestObjPrototypeFunctionOverloadedMethod5(exec);
2140     if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSDOMStringList::s_info)))))
2141         return jsTestObjPrototypeFunctionOverloadedMethod6(exec);
2142     if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSArray::s_info)))))
2143         return jsTestObjPrototypeFunctionOverloadedMethod7(exec);
2144     return throwVMTypeError(exec);
2145 }
2146
2147 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(ExecState* exec)
2148 {
2149     TestObj::classMethod();
2150     return JSValue::encode(jsUndefined());
2151 }
2152
2153 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional(ExecState* exec)
2154 {
2155
2156     size_t argsCount = exec->argumentCount();
2157     if (argsCount <= 0) {
2158
2159         JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional());
2160         return JSValue::encode(result);
2161     }
2162
2163     int arg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
2164     if (exec->hadException())
2165         return JSValue::encode(jsUndefined());
2166
2167     JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional(arg));
2168     return JSValue::encode(result);
2169 }
2170
2171 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod2(ExecState* exec)
2172 {
2173     if (exec->argumentCount() < 1)
2174         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2175     return JSValue::encode(JSTestObj::classMethod2(exec));
2176 }
2177
2178 #if ENABLE(Condition1)
2179 static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod11(ExecState* exec)
2180 {
2181     if (exec->argumentCount() < 1)
2182         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2183     int arg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
2184     if (exec->hadException())
2185         return JSValue::encode(jsUndefined());
2186     TestObj::overloadedMethod1(arg);
2187     return JSValue::encode(jsUndefined());
2188 }
2189
2190 #endif
2191
2192 #if ENABLE(Condition1)
2193 static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod12(ExecState* exec)
2194 {
2195     if (exec->argumentCount() < 1)
2196         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2197     const String& type(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
2198     if (exec->hadException())
2199         return JSValue::encode(jsUndefined());
2200     TestObj::overloadedMethod1(type);
2201     return JSValue::encode(jsUndefined());
2202 }
2203
2204 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecState* exec)
2205 {
2206     size_t argsCount = exec->argumentCount();
2207     if (argsCount == 1)
2208         return jsTestObjConstructorFunctionOverloadedMethod11(exec);
2209     JSValue arg0(exec->argument(0));
2210     if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))
2211         return jsTestObjConstructorFunctionOverloadedMethod12(exec);
2212     return throwVMTypeError(exec);
2213 }
2214
2215 #endif
2216
2217 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithUnsignedLongArray(ExecState* exec)
2218 {
2219     JSValue thisValue = exec->hostThisValue();
2220     if (!thisValue.inherits(&JSTestObj::s_info))
2221         return throwVMTypeError(exec);
2222     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2223     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2224     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2225     if (exec->argumentCount() < 1)
2226         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2227     Vector<unsigned long> unsignedLongArray(jsUnsignedLongArrayToVector(exec, MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2228     if (exec->hadException())
2229         return JSValue::encode(jsUndefined());
2230     impl->methodWithUnsignedLongArray(unsignedLongArray);
2231     return JSValue::encode(jsUndefined());
2232 }
2233
2234 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(ExecState* exec)
2235 {
2236     JSValue thisValue = exec->hostThisValue();
2237     if (!thisValue.inherits(&JSTestObj::s_info))
2238         return throwVMTypeError(exec);
2239     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2240     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2241     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2242     ExceptionCode ec = 0;
2243     if (!shouldAllowAccessToNode(exec, impl->getSVGDocument(ec)))
2244         return JSValue::encode(jsNull());
2245
2246     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->getSVGDocument(ec)));
2247     setDOMException(exec, ec);
2248     return JSValue::encode(result);
2249 }
2250
2251 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(ExecState* exec)
2252 {
2253     JSValue thisValue = exec->hostThisValue();
2254     if (!thisValue.inherits(&JSTestObj::s_info))
2255         return throwVMTypeError(exec);
2256     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2257     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2258     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2259     if (exec->argumentCount() < 1)
2260         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2261     a* (toa(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2262     if (exec->hadException())
2263         return JSValue::encode(jsUndefined());
2264     impl->convert1();
2265     return JSValue::encode(jsUndefined());
2266 }
2267
2268 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec)
2269 {
2270     JSValue thisValue = exec->hostThisValue();
2271     if (!thisValue.inherits(&JSTestObj::s_info))
2272         return throwVMTypeError(exec);
2273     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2274     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2275     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2276     if (exec->argumentCount() < 1)
2277         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2278     b* (tob(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2279     if (exec->hadException())
2280         return JSValue::encode(jsUndefined());
2281     impl->convert2();
2282     return JSValue::encode(jsUndefined());
2283 }
2284
2285 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* exec)
2286 {
2287     JSValue thisValue = exec->hostThisValue();
2288     if (!thisValue.inherits(&JSTestObj::s_info))
2289         return throwVMTypeError(exec);
2290     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2291     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2292     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2293     if (exec->argumentCount() < 1)
2294         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2295     c* (toc(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2296     if (exec->hadException())
2297         return JSValue::encode(jsUndefined());
2298     impl->convert3();
2299     return JSValue::encode(jsUndefined());
2300 }
2301
2302 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec)
2303 {
2304     JSValue thisValue = exec->hostThisValue();
2305     if (!thisValue.inherits(&JSTestObj::s_info))
2306         return throwVMTypeError(exec);
2307     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2308     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2309     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2310     if (exec->argumentCount() < 1)
2311         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2312     d* (tod(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2313     if (exec->hadException())
2314         return JSValue::encode(jsUndefined());
2315     impl->convert4();
2316     return JSValue::encode(jsUndefined());
2317 }
2318
2319 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* exec)
2320 {
2321     JSValue thisValue = exec->hostThisValue();
2322     if (!thisValue.inherits(&JSTestObj::s_info))
2323         return throwVMTypeError(exec);
2324     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2325     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2326     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2327     if (exec->argumentCount() < 1)
2328         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2329     e* (toe(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
2330     if (exec->hadException())
2331         return JSValue::encode(jsUndefined());
2332     impl->convert5();
2333     return JSValue::encode(jsUndefined());
2334 }
2335
2336 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(ExecState* exec)
2337 {
2338     JSValue thisValue = exec->hostThisValue();
2339     if (!thisValue.inherits(&JSTestObj::s_info))
2340         return throwVMTypeError(exec);
2341     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2342     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2343     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2344
2345     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->mutablePointFunction())));
2346     return JSValue::encode(result);
2347 }
2348
2349 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(ExecState* exec)
2350 {
2351     JSValue thisValue = exec->hostThisValue();
2352     if (!thisValue.inherits(&JSTestObj::s_info))
2353         return throwVMTypeError(exec);
2354     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2355     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2356     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2357
2358     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->immutablePointFunction())));
2359     return JSValue::encode(result);
2360 }
2361
2362 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(ExecState* exec)
2363 {
2364     JSValue thisValue = exec->hostThisValue();
2365     if (!thisValue.inherits(&JSTestObj::s_info))
2366         return throwVMTypeError(exec);
2367     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2368     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2369     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2370     impl->banana();
2371     return JSValue::encode(jsUndefined());
2372 }
2373
2374 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(ExecState* exec)
2375 {
2376     JSValue thisValue = exec->hostThisValue();
2377     if (!thisValue.inherits(&JSTestObj::s_info))
2378         return throwVMTypeError(exec);
2379     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
2380     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
2381     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
2382     if (exec->argumentCount() < 3)
2383         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2384     ExceptionCode ec = 0;
2385     const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
2386     if (exec->hadException())
2387         return JSValue::encode(jsUndefined());
2388     float a(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toFloat(exec));
2389     if (exec->hadException())
2390         return JSValue::encode(jsUndefined());
2391     if (exec->argumentCount() > 2 && !exec->argument(2).isUndefinedOrNull() && !exec->argument(2).inherits(&JSint::s_info))
2392         return throwVMTypeError(exec);
2393     int* b(toint(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
2394     if (exec->hadException())
2395         return JSValue::encode(jsUndefined());
2396
2397     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->strictFunction(str, a, b, ec)));
2398     setDOMException(exec, ec);
2399     return JSValue::encode(result);
2400 }
2401
2402 void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
2403 {
2404     JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
2405     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
2406     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
2407     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
2408     Base::visitChildren(thisObject, visitor);
2409     if (thisObject->m_cachedAttribute1)
2410         visitor.append(&thisObject->m_cachedAttribute1);
2411     if (thisObject->m_cachedAttribute2)
2412         visitor.append(&thisObject->m_cachedAttribute2);
2413 }
2414
2415 // Constant getters
2416
2417 #if ENABLE(Condition1)
2418 JSValue jsTestObjCONDITIONAL_CONST(ExecState* exec, JSValue, const Identifier&)
2419 {
2420     UNUSED_PARAM(exec);
2421     return jsNumber(static_cast<int>(0));
2422 }
2423
2424 #endif
2425 JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&)
2426 {
2427     UNUSED_PARAM(exec);
2428     return jsNumber(static_cast<int>(0));
2429 }
2430
2431 JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, const Identifier&)
2432 {
2433     UNUSED_PARAM(exec);
2434     return jsNumber(static_cast<int>(1));
2435 }
2436
2437 JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, const Identifier&)
2438 {
2439     UNUSED_PARAM(exec);
2440     return jsNumber(static_cast<int>(2));
2441 }
2442
2443 JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, const Identifier&)
2444 {
2445     UNUSED_PARAM(exec);
2446     return jsNumber(static_cast<int>(4));
2447 }
2448
2449 JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&)
2450 {
2451     UNUSED_PARAM(exec);
2452     return jsNumber(static_cast<int>(8));
2453 }
2454
2455 JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&)
2456 {
2457     UNUSED_PARAM(exec);
2458     return jsNumber(static_cast<int>(-1));
2459 }
2460
2461 JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&)
2462 {
2463     return jsStringOrNull(exec, String("my constant string"));
2464 }
2465
2466 JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&)
2467 {
2468     UNUSED_PARAM(exec);
2469     return jsNumber(static_cast<int>(0xffffffff));
2470 }
2471
2472 JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&)
2473 {
2474     UNUSED_PARAM(exec);
2475     return jsNumber(static_cast<int>(0x01));
2476 }
2477
2478 JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&)
2479 {
2480     UNUSED_PARAM(exec);
2481     return jsNumber(static_cast<int>(0X20));
2482 }
2483
2484 JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&)
2485 {
2486     UNUSED_PARAM(exec);
2487     return jsNumber(static_cast<int>(0x1abc));
2488 }
2489
2490 JSValue jsTestObjCONST_JAVASCRIPT(ExecState* exec, JSValue, const Identifier&)
2491 {
2492     UNUSED_PARAM(exec);
2493     return jsNumber(static_cast<int>(15));
2494 }
2495
2496 static inline bool isObservable(JSTestObj* jsTestObj)
2497 {
2498     if (jsTestObj->hasCustomProperties())
2499         return true;
2500     return false;
2501 }
2502
2503 bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
2504 {
2505     JSTestObj* jsTestObj = jsCast<JSTestObj*>(handle.get().asCell());
2506     if (!isObservable(jsTestObj))
2507         return false;
2508     UNUSED_PARAM(visitor);
2509     return false;
2510 }
2511
2512 void JSTestObjOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
2513 {
2514     JSTestObj* jsTestObj = jsCast<JSTestObj*>(handle.get().asCell());
2515     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
2516     uncacheWrapper(world, jsTestObj->impl(), jsTestObj);
2517     jsTestObj->releaseImpl();
2518 }
2519
2520 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* impl)
2521 {
2522     return wrap<JSTestObj>(exec, globalObject, impl);
2523 }
2524
2525 TestObj* toTestObj(JSC::JSValue value)
2526 {
2527     return value.inherits(&JSTestObj::s_info) ? jsCast<JSTestObj*>(asObject(value))->impl() : 0;
2528 }
2529
2530 }