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