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