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