2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSTestObj.h"
25 #include "ExceptionCode.h"
26 #include "HTMLNames.h"
27 #include "IDBBindingUtilities.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"
46 #include "SVGDocument.h"
47 #include "SVGStaticPropertyTearOff.h"
48 #include "ScriptArguments.h"
49 #include "ScriptCallStack.h"
50 #include "ScriptCallStackFactory.h"
51 #include "SerializedScriptValue.h"
54 #include <runtime/Error.h>
55 #include <runtime/JSString.h>
56 #include <wtf/GetPtr.h>
58 #if ENABLE(Condition1)
59 #include "JSTestObjectA.h"
62 #if ENABLE(Condition1) && ENABLE(Condition2)
63 #include "JSTestObjectB.h"
66 #if ENABLE(Condition1) || ENABLE(Condition2)
67 #include "JSTestObjectC.h"
74 ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
77 static const HashTableValue JSTestObjTableValues[] =
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 },
116 #if ENABLE(Condition1) && ENABLE(Condition2)
117 { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2, NoIntrinsic },
119 #if ENABLE(Condition1) || ENABLE(Condition2)
120 { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3, NoIntrinsic },
122 #if ENABLE(Condition1)
123 { "conditionalAttr4", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t)setJSTestObjConditionalAttr4Constructor, NoIntrinsic },
125 #if ENABLE(Condition1) && ENABLE(Condition2)
126 { "conditionalAttr5", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr5Constructor), (intptr_t)setJSTestObjConditionalAttr5Constructor, NoIntrinsic },
128 #if ENABLE(Condition1) || ENABLE(Condition2)
129 { "conditionalAttr6", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr6Constructor), (intptr_t)setJSTestObjConditionalAttr6Constructor, NoIntrinsic },
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 }
144 static const HashTable JSTestObjTable = { 137, 127, JSTestObjTableValues, 0 };
145 /* Hash table for constructor */
147 static const HashTableValue JSTestObjConstructorTableValues[] =
149 #if ENABLE(Condition1)
150 { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0, NoIntrinsic },
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 },
170 { 0, 0, 0, 0, NoIntrinsic }
173 static const HashTable JSTestObjConstructorTable = { 36, 31, JSTestObjConstructorTableValues, 0 };
175 #if ENABLE(Condition1)
176 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDoNotCheckConstants);
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);
191 const ClassInfo JSTestObjConstructor::s_info = { "TestObjectConstructor", &Base::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
193 JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
194 : DOMConstructorObject(structure, globalObject)
198 void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
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);
206 bool JSTestObjConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
208 return getStaticPropertySlot<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, static_cast<JSTestObjConstructor*>(cell), propertyName, slot);
211 bool JSTestObjConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
213 return getStaticPropertyDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, static_cast<JSTestObjConstructor*>(object), propertyName, descriptor);
216 EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::constructJSTestObj(ExecState* exec)
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())));
223 ConstructType JSTestObjConstructor::getConstructData(JSCell*, ConstructData& constructData)
225 constructData.native.function = constructJSTestObj;
226 return ConstructTypeHost;
229 /* Hash table for prototype */
231 static const HashTableValue JSTestObjPrototypeTableValues[] =
233 #if ENABLE(Condition1)
234 { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0, NoIntrinsic },
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 },
284 #if ENABLE(Condition1) && ENABLE(Condition2)
285 { "conditionalMethod2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod2), (intptr_t)0, NoIntrinsic },
287 #if ENABLE(Condition1) || ENABLE(Condition2)
288 { "conditionalMethod3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t)0, NoIntrinsic },
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 }
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) };
308 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
310 return getDOMPrototype<JSTestObj>(exec, globalObject);
313 bool JSTestObjPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
315 JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(cell);
316 return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, slot);
319 bool JSTestObjPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
321 JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(object);
322 return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, descriptor);
325 const ClassInfo JSTestObj::s_info = { "TestObject", &Base::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) };
327 JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
328 : JSDOMWrapper(structure, globalObject)
329 , m_impl(impl.leakRef())
333 void JSTestObj::finishCreation(JSGlobalData& globalData)
335 Base::finishCreation(globalData);
336 ASSERT(inherits(&s_info));
339 JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
341 return JSTestObjPrototype::create(exec->globalData(), globalObject, JSTestObjPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
344 void JSTestObj::destroy(JSC::JSCell* cell)
346 JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
347 thisObject->JSTestObj::~JSTestObj();
350 JSTestObj::~JSTestObj()
352 releaseImplIfNotNull();
355 bool JSTestObj::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
357 JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
358 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
359 return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, slot);
362 bool JSTestObj::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
364 JSTestObj* thisObject = jsCast<JSTestObj*>(object);
365 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
366 return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, descriptor);
369 JSValue jsTestObjReadOnlyIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
371 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
373 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
374 JSValue result = jsNumber(impl->readOnlyIntAttr());
379 JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
381 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
383 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
384 JSValue result = jsString(exec, impl->readOnlyStringAttr());
389 JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
391 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
393 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
394 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->readOnlyTestObjAttr()));
399 JSValue jsTestObjShortAttr(ExecState* exec, JSValue slotBase, const Identifier&)
401 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
403 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
404 JSValue result = jsNumber(impl->shortAttr());
409 JSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSValue slotBase, const Identifier&)
411 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
413 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
414 JSValue result = jsNumber(impl->unsignedShortAttr());
419 JSValue jsTestObjIntAttr(ExecState* exec, JSValue slotBase, const Identifier&)
421 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
423 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
424 JSValue result = jsNumber(impl->intAttr());
429 JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
431 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
433 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
434 JSValue result = jsNumber(impl->longLongAttr());
439 JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
441 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
443 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
444 JSValue result = jsNumber(impl->unsignedLongLongAttr());
449 JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
451 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
453 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
454 JSValue result = jsString(exec, impl->stringAttr());
459 JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
461 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
463 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
464 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->testObjAttr()));
469 JSValue jsTestObjXMLObjAttr(ExecState* exec, JSValue slotBase, const Identifier&)
471 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
473 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
474 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->xmlObjAttr()));
479 JSValue jsTestObjCreate(ExecState* exec, JSValue slotBase, const Identifier&)
481 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
483 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
484 JSValue result = jsBoolean(impl->isCreate());
489 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
491 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
493 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
494 JSValue result = jsString(exec, impl->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
499 JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
501 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
503 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
504 JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
509 JSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
511 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
513 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
514 JSValue result = jsNumber(std::max(0, impl->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
519 JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
521 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
523 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
524 JSValue result = jsBoolean(impl->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
529 JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
531 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
533 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
534 JSValue result = jsString(exec, impl->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
539 JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
541 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
543 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
544 JSValue result = jsString(exec, impl->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
549 JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
551 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
553 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
554 JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
559 JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
561 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
563 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
564 JSValue result = jsBoolean(impl->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
569 JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
571 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
573 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
574 JSValue result = jsString(exec, impl->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
579 JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
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);
590 JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
592 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
594 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
595 JSValue result = jsNumber(impl->attrWithSetterException());
600 JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
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);
611 JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
613 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
615 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
616 JSValue result = jsString(exec, impl->stringAttrWithSetterException());
621 JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier&)
623 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
624 return castedThis->customAttr(exec);
628 JSValue jsTestObjWithScriptStateAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
630 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
631 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
632 JSValue result = jsNumber(impl->withScriptStateAttribute(exec));
637 JSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
639 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
640 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
642 return jsUndefined();
643 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
644 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttribute(scriptContext)));
649 JSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
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);
660 JSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
662 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
663 ExceptionCode ec = 0;
664 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
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);
674 JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
676 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
677 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
679 return jsUndefined();
680 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
681 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext)));
686 JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
688 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
689 ExceptionCode ec = 0;
690 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
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);
700 JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
702 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
703 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
705 return jsUndefined();
706 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
707 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext)));
712 JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
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)));
722 #if ENABLE(Condition1)
723 JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
725 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
727 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
728 JSValue result = jsNumber(impl->conditionalAttr1());
734 #if ENABLE(Condition1) && ENABLE(Condition2)
735 JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&)
737 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
739 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
740 JSValue result = jsNumber(impl->conditionalAttr2());
746 #if ENABLE(Condition1) || ENABLE(Condition2)
747 JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&)
749 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
751 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
752 JSValue result = jsNumber(impl->conditionalAttr3());
758 #if ENABLE(Condition1)
759 JSValue jsTestObjConditionalAttr4Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
761 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
762 return JSTestObjectA::getConstructor(exec, castedThis);
767 #if ENABLE(Condition1) && ENABLE(Condition2)
768 JSValue jsTestObjConditionalAttr5Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
770 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
771 return JSTestObjectB::getConstructor(exec, castedThis);
776 #if ENABLE(Condition1) || ENABLE(Condition2)
777 JSValue jsTestObjConditionalAttr6Constructor(ExecState* exec, JSValue slotBase, const Identifier&)
779 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
780 return JSTestObjectC::getConstructor(exec, castedThis);
785 JSValue jsTestObjCachedAttribute1(ExecState* exec, JSValue slotBase, const Identifier&)
787 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
789 if (JSValue cachedValue = castedThis->m_cachedAttribute1.get())
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);
798 JSValue jsTestObjCachedAttribute2(ExecState* exec, JSValue slotBase, const Identifier&)
800 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
802 if (JSValue cachedValue = castedThis->m_cachedAttribute2.get())
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);
811 JSValue jsTestObjContentDocument(ExecState* exec, JSValue slotBase, const Identifier&)
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();
819 JSValue jsTestObjMutablePoint(ExecState* exec, JSValue slotBase, const Identifier&)
821 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
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)));
829 JSValue jsTestObjImmutablePoint(ExecState* exec, JSValue slotBase, const Identifier&)
831 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
833 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
834 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->immutablePoint())));
839 JSValue jsTestObjStrictFloat(ExecState* exec, JSValue slotBase, const Identifier&)
841 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
843 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
844 JSValue result = jsNumber(impl->strictFloat());
849 JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
851 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
853 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
854 JSValue result = jsNumber(impl->description());
859 JSValue jsTestObjId(ExecState* exec, JSValue slotBase, const Identifier&)
861 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
863 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
864 JSValue result = jsNumber(impl->id());
869 JSValue jsTestObjHash(ExecState* exec, JSValue slotBase, const Identifier&)
871 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
873 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
874 JSValue result = jsString(exec, impl->hash());
879 JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
881 JSTestObj* domObject = static_cast<JSTestObj*>(asObject(slotBase));
882 return JSTestObj::getConstructor(exec, domObject->globalObject());
885 void JSTestObj::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
887 JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
888 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
889 lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, thisObject, slot);
892 void setJSTestObjShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
894 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
895 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
896 impl->setShortAttr(value.toInt32(exec));
900 void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
902 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
903 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
904 impl->setUnsignedShortAttr(value.toUInt32(exec));
908 void setJSTestObjIntAttr(ExecState* exec, JSObject* thisObject, JSValue value)
910 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
911 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
912 impl->setIntAttr(value.toInt32(exec));
916 void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
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)));
924 void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
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)));
932 void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
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)));
940 void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
942 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
943 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
944 impl->setTestObjAttr(toTestObj(value));
948 void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* thisObject, JSValue value)
950 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
951 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
952 impl->setXMLObjAttr(toTestObj(value));
956 void setJSTestObjCreate(ExecState* exec, JSObject* thisObject, JSValue value)
958 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
959 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
960 impl->setCreate(value.toBoolean(exec));
964 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
966 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
967 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
968 impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
972 void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
974 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
975 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
976 impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec));
980 void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
982 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
983 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
984 impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, value.toUInt32(exec));
988 void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
990 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
991 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
992 impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
996 void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
998 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
999 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1000 impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
1004 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1006 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1007 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1008 impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
1012 void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1014 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1015 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1016 impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec));
1020 void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1022 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1023 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1024 impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
1028 void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1030 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1031 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1032 impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
1036 void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
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);
1046 void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
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);
1056 void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
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);
1066 void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
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);
1076 void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value)
1078 static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
1082 void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1084 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1085 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1086 impl->setWithScriptStateAttribute(exec, value.toInt32(exec));
1090 void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1092 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1093 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1094 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1097 impl->setWithScriptExecutionContextAttribute(scriptContext, toTestObj(value));
1101 void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
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);
1111 void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
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();
1119 impl->setWithScriptExecutionContextAttributeRaises(scriptContext, toTestObj(value), ec);
1120 setDOMException(exec, ec);
1124 void setJSTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1126 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1127 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1128 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1131 impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, toTestObj(value));
1135 void setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
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();
1143 impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, toTestObj(value), ec);
1144 setDOMException(exec, ec);
1148 void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
1150 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1151 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1152 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1155 impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, toTestObj(value));
1159 void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
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));
1168 #if ENABLE(Condition1)
1169 void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
1171 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1172 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1173 impl->setConditionalAttr1(value.toInt32(exec));
1178 #if ENABLE(Condition1) && ENABLE(Condition2)
1179 void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value)
1181 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1182 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1183 impl->setConditionalAttr2(value.toInt32(exec));
1188 #if ENABLE(Condition1) || ENABLE(Condition2)
1189 void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value)
1191 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1192 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1193 impl->setConditionalAttr3(value.toInt32(exec));
1198 #if ENABLE(Condition1)
1199 void setJSTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1201 // Shadowing a built-in constructor
1202 static_cast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr4"), value);
1207 #if ENABLE(Condition1) && ENABLE(Condition2)
1208 void setJSTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1210 // Shadowing a built-in constructor
1211 static_cast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr5"), value);
1216 #if ENABLE(Condition1) || ENABLE(Condition2)
1217 void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* thisObject, JSValue value)
1219 // Shadowing a built-in constructor
1220 static_cast<JSTestObj*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, "conditionalAttr6"), value);
1225 void setJSTestObjMutablePoint(ExecState* exec, JSObject* thisObject, JSValue value)
1227 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1228 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1229 impl->setMutablePoint(toSVGPoint(value));
1233 void setJSTestObjImmutablePoint(ExecState* exec, JSObject* thisObject, JSValue value)
1235 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1236 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1237 impl->setImmutablePoint(toSVGPoint(value));
1241 void setJSTestObjStrictFloat(ExecState* exec, JSObject* thisObject, JSValue value)
1243 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1244 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1245 impl->setStrictFloat(value.toFloat(exec));
1249 void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
1251 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
1252 TestObj* impl = static_cast<TestObj*>(castedThis->impl());
1253 impl->setId(value.toInt32(exec));
1257 JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
1259 return getDOMConstructor<JSTestObjConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
1262 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec)
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());
1271 return JSValue::encode(jsUndefined());
1274 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec)
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());
1297 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec)
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());
1306 JSC::JSValue result = jsNumber(impl->intMethod());
1307 return JSValue::encode(result);
1310 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecState* exec)
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());
1330 JSC::JSValue result = jsNumber(impl->intMethodWithArgs(intArg, strArg, objArg));
1331 return JSValue::encode(result);
1334 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec)
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());
1343 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->objMethod()));
1344 return JSValue::encode(result);
1347 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec)
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());
1367 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->objMethodWithArgs(intArg, strArg, objArg)));
1368 return JSValue::encode(result);
1371 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec)
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());
1389 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
1390 setDOMException(exec, ec);
1391 return JSValue::encode(result);
1394 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec)
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());
1411 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec)
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());
1425 return JSValue::encode(jsUndefined());
1428 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec)
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());
1442 size_t argsCount = exec->argumentCount();
1443 if (argsCount <= 1) {
1444 impl->optionsObject(oo);
1445 return JSValue::encode(jsUndefined());
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());
1455 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec)
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());
1469 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec)
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));
1479 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec)
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));
1489 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec)
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());
1506 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec)
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());
1523 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec)
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());
1535 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec)
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());
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);
1550 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec)
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());
1564 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec)
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;
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);
1581 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
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();
1591 return JSValue::encode(jsUndefined());
1592 impl->withScriptExecutionContext(scriptContext);
1593 return JSValue::encode(jsUndefined());
1596 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState(ExecState* exec)
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();
1606 return JSValue::encode(jsUndefined());
1607 impl->withScriptExecutionContextAndScriptState(exec, scriptContext);
1608 return JSValue::encode(jsUndefined());
1611 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException(ExecState* exec)
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();
1622 return JSValue::encode(jsUndefined());
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);
1631 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(ExecState* exec)
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();
1641 return JSValue::encode(jsUndefined());
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);
1649 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(ExecState* exec)
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());
1663 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec)
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());
1672 size_t argsCount = exec->argumentCount();
1673 if (argsCount <= 0) {
1674 impl->methodWithOptionalArg();
1675 return JSValue::encode(jsUndefined());
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());
1685 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec)
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());
1699 size_t argsCount = exec->argumentCount();
1700 if (argsCount <= 1) {
1701 impl->methodWithNonOptionalArgAndOptionalArg(nonOpt);
1702 return JSValue::encode(jsUndefined());
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());
1712 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec)
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());
1726 size_t argsCount = exec->argumentCount();
1727 if (argsCount <= 1) {
1728 impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
1729 return JSValue::encode(jsUndefined());
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());
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());
1747 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(ExecState* exec)
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());
1756 size_t argsCount = exec->argumentCount();
1757 if (argsCount <= 0) {
1758 impl->methodWithOptionalString();
1759 return JSValue::encode(jsUndefined());
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());
1769 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(ExecState* exec)
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());
1784 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString(ExecState* exec)
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());
1799 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* exec)
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());
1813 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1814 impl->methodWithCallbackArg(callback);
1815 return JSValue::encode(jsUndefined());
1818 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec)
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());
1835 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject());
1836 impl->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
1837 return JSValue::encode(jsUndefined());
1840 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec)
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());
1854 callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
1856 impl->methodWithCallbackAndOptionalArg(callback);
1857 return JSValue::encode(jsUndefined());
1860 #if ENABLE(Condition1)
1861 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod1(ExecState* exec)
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());
1870 JSC::JSValue result = jsString(exec, impl->conditionalMethod1());
1871 return JSValue::encode(result);
1876 #if ENABLE(Condition1) && ENABLE(Condition2)
1877 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod2(ExecState* exec)
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());
1891 #if ENABLE(Condition1) || ENABLE(Condition2)
1892 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod3(ExecState* exec)
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());
1906 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
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());
1926 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
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());
1940 size_t argsCount = exec->argumentCount();
1941 if (argsCount <= 1) {
1942 impl->overloadedMethod(objArg);
1943 return JSValue::encode(jsUndefined());
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());
1953 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
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());
1970 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
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());
1987 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod5(ExecState* exec)
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());
2001 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
2002 impl->overloadedMethod(callback);
2003 return JSValue::encode(jsUndefined());
2006 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod6(ExecState* exec)
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());
2023 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod7(ExecState* exec)
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());
2040 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
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);
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);
2062 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(ExecState* exec)
2064 TestObj::classMethod();
2065 return JSValue::encode(jsUndefined());
2068 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional(ExecState* exec)
2071 size_t argsCount = exec->argumentCount();
2072 if (argsCount <= 0) {
2074 JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional());
2075 return JSValue::encode(result);
2078 int arg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInt32(exec));
2079 if (exec->hadException())
2080 return JSValue::encode(jsUndefined());
2082 JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional(arg));
2083 return JSValue::encode(result);
2086 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod2(ExecState* exec)
2088 if (exec->argumentCount() < 1)
2089 return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
2090 return JSValue::encode(JSTestObj::classMethod2(exec));
2093 #if ENABLE(Condition1)
2094 static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod11(ExecState* exec)
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());
2107 #if ENABLE(Condition1)
2108 static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod12(ExecState* exec)
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());
2119 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecState* exec)
2121 size_t argsCount = exec->argumentCount();
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);
2132 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithUnsignedLongArray(ExecState* exec)
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());
2149 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(ExecState* exec)
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());
2161 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->getSVGDocument(ec)));
2162 setDOMException(exec, ec);
2163 return JSValue::encode(result);
2166 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(ExecState* exec)
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());
2180 return JSValue::encode(jsUndefined());
2183 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec)
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());
2197 return JSValue::encode(jsUndefined());
2200 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* exec)
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());
2214 return JSValue::encode(jsUndefined());
2217 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec)
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());
2231 return JSValue::encode(jsUndefined());
2234 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* exec)
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());
2248 return JSValue::encode(jsUndefined());
2251 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(ExecState* exec)
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());
2260 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->mutablePointFunction())));
2261 return JSValue::encode(result);
2264 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(ExecState* exec)
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());
2273 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->immutablePointFunction())));
2274 return JSValue::encode(result);
2277 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(ExecState* exec)
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());
2286 return JSValue::encode(jsUndefined());
2289 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(ExecState* exec)
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());
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);
2317 void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
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);
2332 #if ENABLE(Condition1)
2333 JSValue jsTestObjCONDITIONAL_CONST(ExecState* exec, JSValue, const Identifier&)
2336 return jsNumber(static_cast<int>(0));
2340 JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&)
2343 return jsNumber(static_cast<int>(0));
2346 JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, const Identifier&)
2349 return jsNumber(static_cast<int>(1));
2352 JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, const Identifier&)
2355 return jsNumber(static_cast<int>(2));
2358 JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, const Identifier&)
2361 return jsNumber(static_cast<int>(4));
2364 JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&)
2367 return jsNumber(static_cast<int>(8));
2370 JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&)
2373 return jsNumber(static_cast<int>(-1));
2376 JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&)
2378 return jsStringOrNull(exec, String("my constant string"));
2381 JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&)
2384 return jsNumber(static_cast<int>(0xffffffff));
2387 JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&)
2390 return jsNumber(static_cast<int>(0x01));
2393 JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&)
2396 return jsNumber(static_cast<int>(0X20));
2399 JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&)
2402 return jsNumber(static_cast<int>(0x1abc));
2405 JSValue jsTestObjCONST_JAVASCRIPT(ExecState* exec, JSValue, const Identifier&)
2408 return jsNumber(static_cast<int>(15));
2411 static inline bool isObservable(JSTestObj* jsTestObj)
2413 if (jsTestObj->hasCustomProperties())
2418 bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
2420 JSTestObj* jsTestObj = static_cast<JSTestObj*>(handle.get().asCell());
2421 if (!isObservable(jsTestObj))
2423 UNUSED_PARAM(visitor);
2427 void JSTestObjOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
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();
2435 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* impl)
2437 return wrap<JSTestObj>(exec, globalObject, impl);
2440 TestObj* toTestObj(JSC::JSValue value)
2442 return value.inherits(&JSTestObj::s_info) ? static_cast<JSTestObj*>(asObject(value))->impl() : 0;