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