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"
24 #include "CallbackFunction.h"
25 #include "DOMStringList.h"
26 #include "Dictionary.h"
28 #include "ExceptionCode.h"
30 #include "HTMLNames.h"
31 #include "JSDOMBinding.h"
32 #include "JSDOMStringList.h"
33 #include "JSDocument.h"
34 #include "JSEventListener.h"
36 #include "JSSVGDocument.h"
37 #include "JSSVGPoint.h"
38 #include "JSScriptProfile.h"
39 #include "JSTestCallback.h"
40 #include "JSTestNode.h"
41 #include "JSTestObj.h"
42 #include "JSTestSubObj.h"
44 #include "SVGDocument.h"
46 #include "SVGStaticPropertyTearOff.h"
47 #include "ScriptArguments.h"
48 #include "ScriptCallStackFactory.h"
49 #include "ScriptProfile.h"
50 #include "SerializedScriptValue.h"
55 #include <runtime/Error.h>
56 #include <runtime/JSArray.h>
57 #include <runtime/JSString.h>
58 #include <wtf/GetPtr.h>
60 #if ENABLE(Condition1)
61 #include "JSTestObjectA.h"
64 #if ENABLE(Condition1) && ENABLE(Condition2)
65 #include "JSTestObjectB.h"
68 #if ENABLE(Condition1) || ENABLE(Condition2)
69 #include "JSTestObjectC.h"
78 static const HashTableValue JSTestObjTableValues[] =
80 { "readOnlyLongAttr", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
81 { "readOnlyStringAttr", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
82 { "readOnlyTestObjAttr", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
83 { "TestSubObjEnabledBySetting", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestSubObjEnabledBySettingConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTestSubObjEnabledBySettingConstructor) },
84 { "enumAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjEnumAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjEnumAttr) },
85 { "byteAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjByteAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjByteAttr) },
86 { "octetAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjOctetAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjOctetAttr) },
87 { "shortAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjShortAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjShortAttr) },
88 { "unsignedShortAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedShortAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjUnsignedShortAttr) },
89 { "longAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjLongAttr) },
90 { "longLongAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjLongLongAttr) },
91 { "unsignedLongLongAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjUnsignedLongLongAttr) },
92 { "stringAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttr) },
93 { "testObjAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTestObjAttr) },
94 { "XMLObjAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjXMLObjAttr) },
95 { "create", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCreate) },
96 { "reflectedStringAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedStringAttr) },
97 { "reflectedIntegralAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedIntegralAttr) },
98 { "reflectedUnsignedIntegralAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedUnsignedIntegralAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedUnsignedIntegralAttr) },
99 { "reflectedBooleanAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedBooleanAttr) },
100 { "reflectedURLAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedURLAttr) },
101 { "reflectedStringAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedStringAttr) },
102 { "reflectedCustomIntegralAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomIntegralAttr) },
103 { "reflectedCustomBooleanAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomBooleanAttr) },
104 { "reflectedCustomURLAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomURLAttr) },
105 { "typedArrayAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTypedArrayAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTypedArrayAttr) },
106 { "attrWithGetterException", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithGetterException) },
107 { "attrWithSetterException", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithSetterException) },
108 { "stringAttrWithGetterException", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithGetterException) },
109 { "stringAttrWithSetterException", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithSetterException) },
110 { "customAttr", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCustomAttr) },
111 { "withScriptStateAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptStateAttribute) },
112 { "withScriptExecutionContextAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAttribute) },
113 { "withScriptStateAttributeRaises", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttributeRaises), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptStateAttributeRaises) },
114 { "withScriptExecutionContextAttributeRaises", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttributeRaises), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAttributeRaises) },
115 { "withScriptExecutionContextAndScriptStateAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAndScriptStateAttribute) },
116 { "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises) },
117 { "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute) },
118 { "withScriptArgumentsAndCallStackAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptArgumentsAndCallStackAttribute) },
119 #if ENABLE(Condition1)
120 { "conditionalAttr1", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr1) },
122 #if ENABLE(Condition1) && ENABLE(Condition2)
123 { "conditionalAttr2", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr2) },
125 #if ENABLE(Condition1) || ENABLE(Condition2)
126 { "conditionalAttr3", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr3) },
128 #if ENABLE(Condition1)
129 { "conditionalAttr4", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr4Constructor) },
131 #if ENABLE(Condition1) && ENABLE(Condition2)
132 { "conditionalAttr5", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr5Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr5Constructor) },
134 #if ENABLE(Condition1) || ENABLE(Condition2)
135 { "conditionalAttr6", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr6Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr6Constructor) },
137 { "cachedAttribute1", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
138 { "cachedAttribute2", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
139 { "anyAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAnyAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAnyAttribute) },
140 { "contentDocument", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
141 { "mutablePoint", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMutablePoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjMutablePoint) },
142 { "immutablePoint", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImmutablePoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjImmutablePoint) },
143 { "strawberry", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrawberry), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrawberry) },
144 { "strictFloat", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictFloat), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrictFloat) },
145 { "description", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
146 { "id", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjId) },
147 { "hash", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
148 { "replaceableAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReplaceableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReplaceableAttribute) },
149 { "nullableDoubleAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableDoubleAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
150 { "nullableLongAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
151 { "nullableBooleanAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableBooleanAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
152 { "nullableStringAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
153 { "nullableLongSettableAttribute", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongSettableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjNullableLongSettableAttribute) },
154 { "nullableStringValue", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjNullableStringValue) },
155 { "attribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
156 { "attributeWithReservedEnumType", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithReservedEnumType) },
157 { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
158 { 0, 0, NoIntrinsic, 0, 0 }
161 static const HashTable JSTestObjTable = { 266, 255, true, JSTestObjTableValues, 0 };
162 /* Hash table for constructor */
164 static const HashTableValue JSTestObjConstructorTableValues[] =
166 #if ENABLE(Condition1)
167 { "CONDITIONAL_CONST", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
169 { "CONST_VALUE_0", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
170 { "CONST_VALUE_1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
171 { "CONST_VALUE_2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
172 { "CONST_VALUE_4", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
173 { "CONST_VALUE_8", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
174 { "CONST_VALUE_9", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
175 { "CONST_VALUE_10", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
176 { "CONST_VALUE_11", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
177 { "CONST_VALUE_12", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
178 { "CONST_VALUE_13", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
179 { "CONST_VALUE_14", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
180 { "CONST_JAVASCRIPT", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
181 { "readonly", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadonly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
182 { "staticReadOnlyLongAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
183 { "staticStringAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConstructorStaticStringAttr) },
184 { "TestSubObj", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
185 { "staticMethodWithCallbackAndOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg), (intptr_t) (0) },
186 { "staticMethodWithCallbackArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackArg), (intptr_t) (1) },
187 { "classMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod), (intptr_t) (0) },
188 { "classMethodWithOptional", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethodWithOptional), (intptr_t) (0) },
189 { "classMethod2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod2), (intptr_t) (1) },
190 #if ENABLE(Condition1)
191 { "overloadedMethod1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionOverloadedMethod1), (intptr_t) (1) },
193 { 0, 0, NoIntrinsic, 0, 0 }
196 static const HashTable JSTestObjConstructorTable = { 39, 31, true, JSTestObjConstructorTableValues, 0 };
198 #if ENABLE(Condition1)
199 COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDoNotCheckConstants);
201 COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDoNotCheckConstants);
202 COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDoNotCheckConstants);
203 COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDoNotCheckConstants);
204 COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDoNotCheckConstants);
205 COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDoNotCheckConstants);
206 COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDoNotCheckConstants);
207 COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDoNotCheckConstants);
208 COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDoNotCheckConstants);
209 COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDoNotCheckConstants);
210 COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDoNotCheckConstants);
211 COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDoNotCheckConstants);
212 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
213 COMPILE_ASSERT(0 == TestObj::readonly, TestObjEnumreadonlyIsWrongUseDoNotCheckConstants);
215 EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::constructJSTestObj(ExecState* exec)
217 JSTestObjConstructor* castedThis = jsCast<JSTestObjConstructor*>(exec->callee());
218 if (exec->argumentCount() < 1)
219 return throwVMError(exec, createNotEnoughArgumentsError(exec));
220 if (!exec->argument(0).isFunction())
221 return throwVMTypeError(exec);
222 RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject());
223 RefPtr<TestObj> object = TestObj::create(testCallback);
224 return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
227 const ClassInfo JSTestObjConstructor::s_info = { "TestObjectConstructor", &Base::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) };
229 JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
230 : DOMConstructorObject(structure, globalObject)
234 void JSTestObjConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
236 Base::finishCreation(vm);
237 ASSERT(inherits(info()));
238 putDirect(vm, vm.propertyNames->prototype, JSTestObjPrototype::self(vm, globalObject), DontDelete | ReadOnly);
239 putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
242 bool JSTestObjConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
244 return getStaticPropertySlot<JSTestObjConstructor, JSDOMWrapper>(exec, JSTestObjConstructorTable, jsCast<JSTestObjConstructor*>(object), propertyName, slot);
247 ConstructType JSTestObjConstructor::getConstructData(JSCell*, ConstructData& constructData)
249 constructData.native.function = constructJSTestObj;
250 return ConstructTypeHost;
253 /* Hash table for prototype */
255 static const HashTableValue JSTestObjPrototypeTableValues[] =
257 #if ENABLE(Condition1)
258 { "CONDITIONAL_CONST", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
260 { "CONST_VALUE_0", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
261 { "CONST_VALUE_1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
262 { "CONST_VALUE_2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
263 { "CONST_VALUE_4", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
264 { "CONST_VALUE_8", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
265 { "CONST_VALUE_9", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
266 { "CONST_VALUE_10", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
267 { "CONST_VALUE_11", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
268 { "CONST_VALUE_12", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
269 { "CONST_VALUE_13", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
270 { "CONST_VALUE_14", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
271 { "CONST_JAVASCRIPT", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
272 { "readonly", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadonly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
273 { "voidMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t) (0) },
274 { "voidMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t) (3) },
275 { "byteMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethod), (intptr_t) (0) },
276 { "byteMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethodWithArgs), (intptr_t) (3) },
277 { "octetMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOctetMethod), (intptr_t) (0) },
278 { "octetMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOctetMethodWithArgs), (intptr_t) (3) },
279 { "longMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethod), (intptr_t) (0) },
280 { "longMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethodWithArgs), (intptr_t) (3) },
281 { "objMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t) (0) },
282 { "objMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t) (3) },
283 { "methodWithSequenceArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) },
284 { "methodReturningSequence", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodReturningSequence), (intptr_t) (1) },
285 { "methodWithEnumArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithEnumArg), (intptr_t) (1) },
286 { "methodThatRequiresAllArgsAndThrows", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t) (2) },
287 { "serializedValue", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t) (1) },
288 { "optionsObject", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t) (1) },
289 { "methodWithException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t) (0) },
290 { "customMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t) (0) },
291 { "customMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t) (3) },
292 { "addEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t) (2) },
293 { "removeEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t) (2) },
294 { "withScriptStateVoid", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t) (0) },
295 { "withScriptStateObj", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t) (0) },
296 { "withScriptStateVoidException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t) (0) },
297 { "withScriptStateObjException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t) (0) },
298 { "withScriptExecutionContext", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t) (0) },
299 { "withScriptExecutionContextAndScriptState", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState), (intptr_t) (0) },
300 { "withScriptExecutionContextAndScriptStateObjException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException), (intptr_t) (0) },
301 { "withScriptExecutionContextAndScriptStateWithSpaces", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t) (0) },
302 { "withScriptArgumentsAndCallStack", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t) (0) },
303 { "methodWithOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t) (0) },
304 { "methodWithNonOptionalArgAndOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t) (1) },
305 { "methodWithNonOptionalArgAndTwoOptionalArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t) (1) },
306 { "methodWithOptionalString", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalString), (intptr_t) (0) },
307 { "methodWithOptionalStringIsUndefined", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined), (intptr_t) (0) },
308 { "methodWithOptionalStringIsNullString", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString), (intptr_t) (0) },
309 { "methodWithCallbackArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t) (1) },
310 { "methodWithNonCallbackArgAndCallbackArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t) (2) },
311 { "methodWithCallbackAndOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t) (0) },
312 #if ENABLE(Condition1)
313 { "conditionalMethod1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod1), (intptr_t) (0) },
315 #if ENABLE(Condition1) && ENABLE(Condition2)
316 { "conditionalMethod2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod2), (intptr_t) (0) },
318 #if ENABLE(Condition1) || ENABLE(Condition2)
319 { "conditionalMethod3", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t) (0) },
321 { "overloadedMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t) (2) },
322 { "classMethodWithClamp", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethodWithClamp), (intptr_t) (2) },
323 { "methodWithUnsignedLongSequence", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence), (intptr_t) (1) },
324 { "stringArrayFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStringArrayFunction), (intptr_t) (1) },
325 { "domStringListFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionDomStringListFunction), (intptr_t) (1) },
326 { "getSVGDocument", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t) (0) },
327 { "convert1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t) (1) },
328 { "convert2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t) (1) },
329 { "convert4", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t) (1) },
330 { "convert5", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t) (1) },
331 { "mutablePointFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t) (0) },
332 { "immutablePointFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t) (0) },
333 { "orange", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t) (0) },
334 { "strictFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunction), (intptr_t) (3) },
335 { "strictFunctionWithSequence", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunctionWithSequence), (intptr_t) (2) },
336 { "strictFunctionWithArray", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunctionWithArray), (intptr_t) (2) },
337 { "variadicStringMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicStringMethod), (intptr_t) (2) },
338 { "variadicDoubleMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t) (2) },
339 { "variadicNodeMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t) (2) },
340 { "any", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAny), (intptr_t) (2) },
341 { 0, 0, NoIntrinsic, 0, 0 }
344 static const HashTable JSTestObjPrototypeTable = { 267, 255, true, JSTestObjPrototypeTableValues, 0 };
345 const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
347 JSObject* JSTestObjPrototype::self(VM& vm, JSGlobalObject* globalObject)
349 return getDOMPrototype<JSTestObj>(vm, globalObject);
352 bool JSTestObjPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
354 JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(object);
355 return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, JSTestObjPrototypeTable, thisObject, propertyName, slot);
358 const ClassInfo JSTestObj::s_info = { "TestObject", &Base::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) };
360 JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
361 : JSDOMWrapper(structure, globalObject)
362 , m_impl(impl.leakRef())
366 void JSTestObj::finishCreation(VM& vm)
368 Base::finishCreation(vm);
369 ASSERT(inherits(info()));
372 JSObject* JSTestObj::createPrototype(VM& vm, JSGlobalObject* globalObject)
374 return JSTestObjPrototype::create(vm, globalObject, JSTestObjPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
377 void JSTestObj::destroy(JSC::JSCell* cell)
379 JSTestObj* thisObject = static_cast<JSTestObj*>(cell);
380 thisObject->JSTestObj::~JSTestObj();
383 JSTestObj::~JSTestObj()
385 releaseImplIfNotNull();
388 bool JSTestObj::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
390 JSTestObj* thisObject = jsCast<JSTestObj*>(object);
391 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
392 return getStaticValueSlot<JSTestObj, Base>(exec, JSTestObjTable, thisObject, propertyName, slot);
395 EncodedJSValue jsTestObjReadOnlyLongAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
397 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
398 UNUSED_PARAM(slotBase);
400 return throwVMTypeError(exec);
402 TestObj& impl = castedThis->impl();
403 JSValue result = jsNumber(impl.readOnlyLongAttr());
404 return JSValue::encode(result);
408 EncodedJSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
410 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
411 UNUSED_PARAM(slotBase);
413 return throwVMTypeError(exec);
415 TestObj& impl = castedThis->impl();
416 JSValue result = jsStringWithCache(exec, impl.readOnlyStringAttr());
417 return JSValue::encode(result);
421 EncodedJSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
423 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
424 UNUSED_PARAM(slotBase);
426 return throwVMTypeError(exec);
428 TestObj& impl = castedThis->impl();
429 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.readOnlyTestObjAttr()));
430 return JSValue::encode(result);
434 EncodedJSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
436 UNUSED_PARAM(thisValue);
437 UNUSED_PARAM(slotBase);
439 JSValue result = jsNumber(TestObj::staticReadOnlyLongAttr());
440 return JSValue::encode(result);
444 EncodedJSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
446 UNUSED_PARAM(thisValue);
447 UNUSED_PARAM(slotBase);
449 JSValue result = jsStringWithCache(exec, TestObj::staticStringAttr());
450 return JSValue::encode(result);
454 EncodedJSValue jsTestObjConstructorTestSubObj(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
456 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
457 UNUSED_PARAM(slotBase);
459 return throwVMTypeError(exec);
460 return JSValue::encode(JSTestSubObj::getConstructor(exec->vm(), castedThis->globalObject()));
464 EncodedJSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
466 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
467 UNUSED_PARAM(slotBase);
469 return throwVMTypeError(exec);
470 if (!castedThis->impl().frame())
471 return JSValue::encode(jsUndefined());
472 Settings& settings = castedThis->impl().frame()->settings();
473 if (!settings.testSettingEnabled())
474 return JSValue::encode(jsUndefined());
475 return JSValue::encode(JSTestSubObj::getConstructor(exec->vm(), castedThis->globalObject()));
479 EncodedJSValue jsTestObjEnumAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
481 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
482 UNUSED_PARAM(slotBase);
484 return throwVMTypeError(exec);
486 TestObj& impl = castedThis->impl();
487 JSValue result = jsStringWithCache(exec, impl.enumAttr());
488 return JSValue::encode(result);
492 EncodedJSValue jsTestObjByteAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
494 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
495 UNUSED_PARAM(slotBase);
497 return throwVMTypeError(exec);
499 TestObj& impl = castedThis->impl();
500 JSValue result = jsNumber(impl.byteAttr());
501 return JSValue::encode(result);
505 EncodedJSValue jsTestObjOctetAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
507 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
508 UNUSED_PARAM(slotBase);
510 return throwVMTypeError(exec);
512 TestObj& impl = castedThis->impl();
513 JSValue result = jsNumber(impl.octetAttr());
514 return JSValue::encode(result);
518 EncodedJSValue jsTestObjShortAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
520 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
521 UNUSED_PARAM(slotBase);
523 return throwVMTypeError(exec);
525 TestObj& impl = castedThis->impl();
526 JSValue result = jsNumber(impl.shortAttr());
527 return JSValue::encode(result);
531 EncodedJSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
533 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
534 UNUSED_PARAM(slotBase);
536 return throwVMTypeError(exec);
538 TestObj& impl = castedThis->impl();
539 JSValue result = jsNumber(impl.unsignedShortAttr());
540 return JSValue::encode(result);
544 EncodedJSValue jsTestObjLongAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
546 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
547 UNUSED_PARAM(slotBase);
549 return throwVMTypeError(exec);
551 TestObj& impl = castedThis->impl();
552 JSValue result = jsNumber(impl.longAttr());
553 return JSValue::encode(result);
557 EncodedJSValue jsTestObjLongLongAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
559 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
560 UNUSED_PARAM(slotBase);
562 return throwVMTypeError(exec);
564 TestObj& impl = castedThis->impl();
565 JSValue result = jsNumber(impl.longLongAttr());
566 return JSValue::encode(result);
570 EncodedJSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
572 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
573 UNUSED_PARAM(slotBase);
575 return throwVMTypeError(exec);
577 TestObj& impl = castedThis->impl();
578 JSValue result = jsNumber(impl.unsignedLongLongAttr());
579 return JSValue::encode(result);
583 EncodedJSValue jsTestObjStringAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
585 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
586 UNUSED_PARAM(slotBase);
588 return throwVMTypeError(exec);
590 TestObj& impl = castedThis->impl();
591 JSValue result = jsStringWithCache(exec, impl.stringAttr());
592 return JSValue::encode(result);
596 EncodedJSValue jsTestObjTestObjAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
598 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
599 UNUSED_PARAM(slotBase);
601 return throwVMTypeError(exec);
603 TestObj& impl = castedThis->impl();
604 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.testObjAttr()));
605 return JSValue::encode(result);
609 EncodedJSValue jsTestObjXMLObjAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
611 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
612 UNUSED_PARAM(slotBase);
614 return throwVMTypeError(exec);
616 TestObj& impl = castedThis->impl();
617 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.xmlObjAttr()));
618 return JSValue::encode(result);
622 EncodedJSValue jsTestObjCreate(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
624 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
625 UNUSED_PARAM(slotBase);
627 return throwVMTypeError(exec);
629 TestObj& impl = castedThis->impl();
630 JSValue result = jsBoolean(impl.isCreate());
631 return JSValue::encode(result);
635 EncodedJSValue jsTestObjReflectedStringAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
637 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
638 UNUSED_PARAM(slotBase);
640 return throwVMTypeError(exec);
642 TestObj& impl = castedThis->impl();
643 JSValue result = jsStringWithCache(exec, impl.fastGetAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
644 return JSValue::encode(result);
648 EncodedJSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
650 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
651 UNUSED_PARAM(slotBase);
653 return throwVMTypeError(exec);
655 TestObj& impl = castedThis->impl();
656 JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
657 return JSValue::encode(result);
661 EncodedJSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
663 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
664 UNUSED_PARAM(slotBase);
666 return throwVMTypeError(exec);
668 TestObj& impl = castedThis->impl();
669 JSValue result = jsNumber(std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
670 return JSValue::encode(result);
674 EncodedJSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
676 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
677 UNUSED_PARAM(slotBase);
679 return throwVMTypeError(exec);
681 TestObj& impl = castedThis->impl();
682 JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
683 return JSValue::encode(result);
687 EncodedJSValue jsTestObjReflectedURLAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
689 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
690 UNUSED_PARAM(slotBase);
692 return throwVMTypeError(exec);
694 TestObj& impl = castedThis->impl();
695 JSValue result = jsStringWithCache(exec, impl.getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
696 return JSValue::encode(result);
700 EncodedJSValue jsTestObjReflectedStringAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
702 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
703 UNUSED_PARAM(slotBase);
705 return throwVMTypeError(exec);
707 TestObj& impl = castedThis->impl();
708 JSValue result = jsStringWithCache(exec, impl.fastGetAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
709 return JSValue::encode(result);
713 EncodedJSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
715 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
716 UNUSED_PARAM(slotBase);
718 return throwVMTypeError(exec);
720 TestObj& impl = castedThis->impl();
721 JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
722 return JSValue::encode(result);
726 EncodedJSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
728 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
729 UNUSED_PARAM(slotBase);
731 return throwVMTypeError(exec);
733 TestObj& impl = castedThis->impl();
734 JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
735 return JSValue::encode(result);
739 EncodedJSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
741 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
742 UNUSED_PARAM(slotBase);
744 return throwVMTypeError(exec);
746 TestObj& impl = castedThis->impl();
747 JSValue result = jsStringWithCache(exec, impl.getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
748 return JSValue::encode(result);
752 EncodedJSValue jsTestObjTypedArrayAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
754 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
755 UNUSED_PARAM(slotBase);
757 return throwVMTypeError(exec);
759 TestObj& impl = castedThis->impl();
760 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.typedArrayAttr()));
761 return JSValue::encode(result);
765 EncodedJSValue jsTestObjAttrWithGetterException(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
767 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
768 UNUSED_PARAM(slotBase);
770 return throwVMTypeError(exec);
771 ExceptionCode ec = 0;
772 TestObj& impl = castedThis->impl();
773 JSC::JSValue result = jsNumber(impl.attrWithGetterException(ec));
774 setDOMException(exec, ec);
775 return JSValue::encode(result);
779 EncodedJSValue jsTestObjAttrWithSetterException(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
781 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
782 UNUSED_PARAM(slotBase);
784 return throwVMTypeError(exec);
786 TestObj& impl = castedThis->impl();
787 JSValue result = jsNumber(impl.attrWithSetterException());
788 return JSValue::encode(result);
792 EncodedJSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
794 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
795 UNUSED_PARAM(slotBase);
797 return throwVMTypeError(exec);
798 ExceptionCode ec = 0;
799 TestObj& impl = castedThis->impl();
800 JSC::JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec));
801 setDOMException(exec, ec);
802 return JSValue::encode(result);
806 EncodedJSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
808 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
809 UNUSED_PARAM(slotBase);
811 return throwVMTypeError(exec);
813 TestObj& impl = castedThis->impl();
814 JSValue result = jsStringWithCache(exec, impl.stringAttrWithSetterException());
815 return JSValue::encode(result);
819 EncodedJSValue jsTestObjCustomAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
821 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
822 UNUSED_PARAM(slotBase);
824 return throwVMTypeError(exec);
825 return JSValue::encode(castedThis->customAttr(exec));
829 EncodedJSValue jsTestObjWithScriptStateAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
831 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
832 UNUSED_PARAM(slotBase);
834 return throwVMTypeError(exec);
835 TestObj& impl = castedThis->impl();
836 JSValue result = jsNumber(impl.withScriptStateAttribute(exec));
837 return JSValue::encode(result);
841 EncodedJSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
843 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
844 UNUSED_PARAM(slotBase);
846 return throwVMTypeError(exec);
847 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
849 return JSValue::encode(jsUndefined());
850 TestObj& impl = castedThis->impl();
851 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttribute(scriptContext)));
852 return JSValue::encode(result);
856 EncodedJSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
858 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
859 UNUSED_PARAM(slotBase);
861 return throwVMTypeError(exec);
862 ExceptionCode ec = 0;
863 TestObj& impl = castedThis->impl();
864 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptStateAttributeRaises(exec, ec)));
865 setDOMException(exec, ec);
866 return JSValue::encode(result);
870 EncodedJSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
872 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
873 UNUSED_PARAM(slotBase);
875 return throwVMTypeError(exec);
876 ExceptionCode ec = 0;
877 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
879 return JSValue::encode(jsUndefined());
880 TestObj& impl = castedThis->impl();
881 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(scriptContext, ec)));
882 setDOMException(exec, ec);
883 return JSValue::encode(result);
887 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
889 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
890 UNUSED_PARAM(slotBase);
892 return throwVMTypeError(exec);
893 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
895 return JSValue::encode(jsUndefined());
896 TestObj& impl = castedThis->impl();
897 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext)));
898 return JSValue::encode(result);
902 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
904 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
905 UNUSED_PARAM(slotBase);
907 return throwVMTypeError(exec);
908 ExceptionCode ec = 0;
909 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
911 return JSValue::encode(jsUndefined());
912 TestObj& impl = castedThis->impl();
913 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
914 setDOMException(exec, ec);
915 return JSValue::encode(result);
919 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
921 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
922 UNUSED_PARAM(slotBase);
924 return throwVMTypeError(exec);
925 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
927 return JSValue::encode(jsUndefined());
928 TestObj& impl = castedThis->impl();
929 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext)));
930 return JSValue::encode(result);
934 EncodedJSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
936 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
937 UNUSED_PARAM(slotBase);
939 return throwVMTypeError(exec);
940 TestObj& impl = castedThis->impl();
941 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptArgumentsAndCallStackAttribute()));
942 return JSValue::encode(result);
946 #if ENABLE(Condition1)
947 EncodedJSValue jsTestObjConditionalAttr1(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
949 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
950 UNUSED_PARAM(slotBase);
952 return throwVMTypeError(exec);
954 TestObj& impl = castedThis->impl();
955 JSValue result = jsNumber(impl.conditionalAttr1());
956 return JSValue::encode(result);
961 #if ENABLE(Condition1) && ENABLE(Condition2)
962 EncodedJSValue jsTestObjConditionalAttr2(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
964 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
965 UNUSED_PARAM(slotBase);
967 return throwVMTypeError(exec);
969 TestObj& impl = castedThis->impl();
970 JSValue result = jsNumber(impl.conditionalAttr2());
971 return JSValue::encode(result);
976 #if ENABLE(Condition1) || ENABLE(Condition2)
977 EncodedJSValue jsTestObjConditionalAttr3(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
979 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
980 UNUSED_PARAM(slotBase);
982 return throwVMTypeError(exec);
984 TestObj& impl = castedThis->impl();
985 JSValue result = jsNumber(impl.conditionalAttr3());
986 return JSValue::encode(result);
991 #if ENABLE(Condition1)
992 EncodedJSValue jsTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
994 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
995 UNUSED_PARAM(slotBase);
997 return throwVMTypeError(exec);
998 return JSValue::encode(JSTestObjectA::getConstructor(exec->vm(), castedThis->globalObject()));
1003 #if ENABLE(Condition1) && ENABLE(Condition2)
1004 EncodedJSValue jsTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1006 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1007 UNUSED_PARAM(slotBase);
1009 return throwVMTypeError(exec);
1010 return JSValue::encode(JSTestObjectB::getConstructor(exec->vm(), castedThis->globalObject()));
1015 #if ENABLE(Condition1) || ENABLE(Condition2)
1016 EncodedJSValue jsTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1018 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1019 UNUSED_PARAM(slotBase);
1021 return throwVMTypeError(exec);
1022 return JSValue::encode(JSTestObjectC::getConstructor(exec->vm(), castedThis->globalObject()));
1027 EncodedJSValue jsTestObjCachedAttribute1(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1029 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1030 UNUSED_PARAM(slotBase);
1032 return throwVMTypeError(exec);
1034 if (JSValue cachedValue = castedThis->m_cachedAttribute1.get())
1035 return JSValue::encode(cachedValue);
1036 TestObj& impl = castedThis->impl();
1037 JSValue result = (impl.cachedAttribute1().hasNoValue() ? jsNull() : impl.cachedAttribute1().jsValue());
1038 castedThis->m_cachedAttribute1.set(exec->vm(), castedThis, result);
1039 return JSValue::encode(result);
1043 EncodedJSValue jsTestObjCachedAttribute2(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1045 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1046 UNUSED_PARAM(slotBase);
1048 return throwVMTypeError(exec);
1050 if (JSValue cachedValue = castedThis->m_cachedAttribute2.get())
1051 return JSValue::encode(cachedValue);
1052 TestObj& impl = castedThis->impl();
1053 JSValue result = (impl.cachedAttribute2().hasNoValue() ? jsNull() : impl.cachedAttribute2().jsValue());
1054 castedThis->m_cachedAttribute2.set(exec->vm(), castedThis, result);
1055 return JSValue::encode(result);
1059 EncodedJSValue jsTestObjAnyAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1061 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1062 UNUSED_PARAM(slotBase);
1064 return throwVMTypeError(exec);
1066 TestObj& impl = castedThis->impl();
1067 JSValue result = (impl.anyAttribute().hasNoValue() ? jsNull() : impl.anyAttribute().jsValue());
1068 return JSValue::encode(result);
1072 EncodedJSValue jsTestObjContentDocument(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1074 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1075 UNUSED_PARAM(slotBase);
1077 return throwVMTypeError(exec);
1078 TestObj& impl = castedThis->impl();
1079 return JSValue::encode(shouldAllowAccessToNode(exec, impl.contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.contentDocument())) : jsNull());
1083 EncodedJSValue jsTestObjMutablePoint(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1085 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1086 UNUSED_PARAM(slotBase);
1088 return throwVMTypeError(exec);
1090 TestObj& impl = castedThis->impl();
1091 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint)));
1092 return JSValue::encode(result);
1096 EncodedJSValue jsTestObjImmutablePoint(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1098 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1099 UNUSED_PARAM(slotBase);
1101 return throwVMTypeError(exec);
1103 TestObj& impl = castedThis->impl();
1104 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint())));
1105 return JSValue::encode(result);
1109 EncodedJSValue jsTestObjStrawberry(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1111 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1112 UNUSED_PARAM(slotBase);
1114 return throwVMTypeError(exec);
1116 TestObj& impl = castedThis->impl();
1117 JSValue result = jsNumber(impl.blueberry());
1118 return JSValue::encode(result);
1122 EncodedJSValue jsTestObjStrictFloat(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1124 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1125 UNUSED_PARAM(slotBase);
1127 return throwVMTypeError(exec);
1129 TestObj& impl = castedThis->impl();
1130 JSValue result = jsNumber(impl.strictFloat());
1131 return JSValue::encode(result);
1135 EncodedJSValue jsTestObjDescription(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1137 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1138 UNUSED_PARAM(slotBase);
1140 return throwVMTypeError(exec);
1142 TestObj& impl = castedThis->impl();
1143 JSValue result = jsNumber(impl.description());
1144 return JSValue::encode(result);
1148 EncodedJSValue jsTestObjId(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1150 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1151 UNUSED_PARAM(slotBase);
1153 return throwVMTypeError(exec);
1155 TestObj& impl = castedThis->impl();
1156 JSValue result = jsNumber(impl.id());
1157 return JSValue::encode(result);
1161 EncodedJSValue jsTestObjHash(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1163 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1164 UNUSED_PARAM(slotBase);
1166 return throwVMTypeError(exec);
1168 TestObj& impl = castedThis->impl();
1169 JSValue result = jsStringWithCache(exec, impl.hash());
1170 return JSValue::encode(result);
1174 EncodedJSValue jsTestObjReplaceableAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1176 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1177 UNUSED_PARAM(slotBase);
1179 return throwVMTypeError(exec);
1181 TestObj& impl = castedThis->impl();
1182 JSValue result = jsNumber(impl.replaceableAttribute());
1183 return JSValue::encode(result);
1187 EncodedJSValue jsTestObjNullableDoubleAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1189 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1190 UNUSED_PARAM(slotBase);
1192 return throwVMTypeError(exec);
1194 bool isNull = false;
1195 TestObj& impl = castedThis->impl();
1196 JSValue result = jsNumber(impl.nullableDoubleAttribute(isNull));
1198 return JSValue::encode(jsNull());
1199 return JSValue::encode(result);
1203 EncodedJSValue jsTestObjNullableLongAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1205 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1206 UNUSED_PARAM(slotBase);
1208 return throwVMTypeError(exec);
1210 bool isNull = false;
1211 TestObj& impl = castedThis->impl();
1212 JSValue result = jsNumber(impl.nullableLongAttribute(isNull));
1214 return JSValue::encode(jsNull());
1215 return JSValue::encode(result);
1219 EncodedJSValue jsTestObjNullableBooleanAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1221 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1222 UNUSED_PARAM(slotBase);
1224 return throwVMTypeError(exec);
1226 bool isNull = false;
1227 TestObj& impl = castedThis->impl();
1228 JSValue result = jsBoolean(impl.nullableBooleanAttribute(isNull));
1230 return JSValue::encode(jsNull());
1231 return JSValue::encode(result);
1235 EncodedJSValue jsTestObjNullableStringAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1237 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1238 UNUSED_PARAM(slotBase);
1240 return throwVMTypeError(exec);
1242 bool isNull = false;
1243 TestObj& impl = castedThis->impl();
1244 JSValue result = jsStringWithCache(exec, impl.nullableStringAttribute(isNull));
1246 return JSValue::encode(jsNull());
1247 return JSValue::encode(result);
1251 EncodedJSValue jsTestObjNullableLongSettableAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1253 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1254 UNUSED_PARAM(slotBase);
1256 return throwVMTypeError(exec);
1258 bool isNull = false;
1259 TestObj& impl = castedThis->impl();
1260 JSValue result = jsNumber(impl.nullableLongSettableAttribute(isNull));
1262 return JSValue::encode(jsNull());
1263 return JSValue::encode(result);
1267 EncodedJSValue jsTestObjNullableStringValue(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1269 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1270 UNUSED_PARAM(slotBase);
1272 return throwVMTypeError(exec);
1273 ExceptionCode ec = 0;
1274 bool isNull = false;
1275 TestObj& impl = castedThis->impl();
1276 JSC::JSValue result = jsNumber(impl.nullableStringValue(isNull, ec));
1278 return JSValue::encode(jsNull());
1279 setDOMException(exec, ec);
1280 return JSValue::encode(result);
1284 EncodedJSValue jsTestObjAttribute(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1286 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1287 UNUSED_PARAM(slotBase);
1289 return throwVMTypeError(exec);
1291 TestObj& impl = castedThis->impl();
1292 JSValue result = jsStringWithCache(exec, impl.attribute());
1293 return JSValue::encode(result);
1297 EncodedJSValue jsTestObjAttributeWithReservedEnumType(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
1299 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1300 UNUSED_PARAM(slotBase);
1302 return throwVMTypeError(exec);
1304 TestObj& impl = castedThis->impl();
1305 JSValue result = jsStringWithCache(exec, impl.attributeWithReservedEnumType());
1306 return JSValue::encode(result);
1310 EncodedJSValue jsTestObjConstructor(ExecState* exec, JSObject*, EncodedJSValue thisValue, PropertyName)
1312 JSTestObj* domObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1314 return throwVMTypeError(exec);
1315 return JSValue::encode(JSTestObj::getConstructor(exec->vm(), domObject->globalObject()));
1318 void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue, EncodedJSValue encodedValue)
1320 JSValue value = JSValue::decode(encodedValue);
1322 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
1323 if (exec->hadException())
1325 TestObj::setStaticStringAttr(nativeValue);
1329 void setJSTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1331 JSValue value = JSValue::decode(encodedValue);
1333 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1335 throwVMTypeError(exec);
1338 // Shadowing a built-in constructor
1339 castedThis->putDirect(exec->vm(), Identifier(exec, "TestSubObjEnabledBySetting"), value);
1343 void setJSTestObjEnumAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1345 JSValue value = JSValue::decode(encodedValue);
1347 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1349 throwVMTypeError(exec);
1352 TestObj& impl = castedThis->impl();
1353 const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
1354 if (exec->hadException())
1356 if (nativeValue != "" && nativeValue != "EnumValue1" && nativeValue != "EnumValue2" && nativeValue != "EnumValue3")
1358 impl.setEnumAttr(nativeValue);
1362 void setJSTestObjByteAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1364 JSValue value = JSValue::decode(encodedValue);
1366 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1368 throwVMTypeError(exec);
1371 TestObj& impl = castedThis->impl();
1372 int8_t nativeValue(toInt8(exec, value, NormalConversion));
1373 if (exec->hadException())
1375 impl.setByteAttr(nativeValue);
1379 void setJSTestObjOctetAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1381 JSValue value = JSValue::decode(encodedValue);
1383 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1385 throwVMTypeError(exec);
1388 TestObj& impl = castedThis->impl();
1389 uint8_t nativeValue(toUInt8(exec, value, NormalConversion));
1390 if (exec->hadException())
1392 impl.setOctetAttr(nativeValue);
1396 void setJSTestObjShortAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1398 JSValue value = JSValue::decode(encodedValue);
1400 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1402 throwVMTypeError(exec);
1405 TestObj& impl = castedThis->impl();
1406 int16_t nativeValue(toInt16(exec, value, NormalConversion));
1407 if (exec->hadException())
1409 impl.setShortAttr(nativeValue);
1413 void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1415 JSValue value = JSValue::decode(encodedValue);
1417 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1419 throwVMTypeError(exec);
1422 TestObj& impl = castedThis->impl();
1423 uint16_t nativeValue(toUInt16(exec, value, NormalConversion));
1424 if (exec->hadException())
1426 impl.setUnsignedShortAttr(nativeValue);
1430 void setJSTestObjLongAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1432 JSValue value = JSValue::decode(encodedValue);
1434 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1436 throwVMTypeError(exec);
1439 TestObj& impl = castedThis->impl();
1440 int nativeValue(toInt32(exec, value, NormalConversion));
1441 if (exec->hadException())
1443 impl.setLongAttr(nativeValue);
1447 void setJSTestObjLongLongAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1449 JSValue value = JSValue::decode(encodedValue);
1451 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1453 throwVMTypeError(exec);
1456 TestObj& impl = castedThis->impl();
1457 long long nativeValue(toInt64(exec, value, NormalConversion));
1458 if (exec->hadException())
1460 impl.setLongLongAttr(nativeValue);
1464 void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1466 JSValue value = JSValue::decode(encodedValue);
1468 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1470 throwVMTypeError(exec);
1473 TestObj& impl = castedThis->impl();
1474 unsigned long long nativeValue(toUInt64(exec, value, NormalConversion));
1475 if (exec->hadException())
1477 impl.setUnsignedLongLongAttr(nativeValue);
1481 void setJSTestObjStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1483 JSValue value = JSValue::decode(encodedValue);
1485 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1487 throwVMTypeError(exec);
1490 TestObj& impl = castedThis->impl();
1491 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
1492 if (exec->hadException())
1494 impl.setStringAttr(nativeValue);
1498 void setJSTestObjTestObjAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1500 JSValue value = JSValue::decode(encodedValue);
1502 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1504 throwVMTypeError(exec);
1507 TestObj& impl = castedThis->impl();
1508 TestObj* nativeValue(toTestObj(value));
1509 if (exec->hadException())
1511 impl.setTestObjAttr(nativeValue);
1515 void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1517 JSValue value = JSValue::decode(encodedValue);
1519 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1521 throwVMTypeError(exec);
1524 TestObj& impl = castedThis->impl();
1525 TestObj* nativeValue(toTestObj(value));
1526 if (exec->hadException())
1528 impl.setXMLObjAttr(nativeValue);
1532 void setJSTestObjCreate(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1534 JSValue value = JSValue::decode(encodedValue);
1536 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1538 throwVMTypeError(exec);
1541 TestObj& impl = castedThis->impl();
1542 bool nativeValue(value.toBoolean(exec));
1543 if (exec->hadException())
1545 impl.setCreate(nativeValue);
1549 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1551 JSValue value = JSValue::decode(encodedValue);
1553 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1555 throwVMTypeError(exec);
1558 TestObj& impl = castedThis->impl();
1559 const String& nativeValue(valueToStringWithNullCheck(exec, value));
1560 if (exec->hadException())
1562 impl.setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue);
1566 void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1568 JSValue value = JSValue::decode(encodedValue);
1570 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1572 throwVMTypeError(exec);
1575 TestObj& impl = castedThis->impl();
1576 int nativeValue(toInt32(exec, value, NormalConversion));
1577 if (exec->hadException())
1579 impl.setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, nativeValue);
1583 void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1585 JSValue value = JSValue::decode(encodedValue);
1587 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1589 throwVMTypeError(exec);
1592 TestObj& impl = castedThis->impl();
1593 unsigned nativeValue(toUInt32(exec, value, NormalConversion));
1594 if (exec->hadException())
1596 impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, nativeValue);
1600 void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1602 JSValue value = JSValue::decode(encodedValue);
1604 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1606 throwVMTypeError(exec);
1609 TestObj& impl = castedThis->impl();
1610 bool nativeValue(value.toBoolean(exec));
1611 if (exec->hadException())
1613 impl.setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, nativeValue);
1617 void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1619 JSValue value = JSValue::decode(encodedValue);
1621 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1623 throwVMTypeError(exec);
1626 TestObj& impl = castedThis->impl();
1627 const String& nativeValue(valueToStringWithNullCheck(exec, value));
1628 if (exec->hadException())
1630 impl.setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue);
1634 void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1636 JSValue value = JSValue::decode(encodedValue);
1638 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1640 throwVMTypeError(exec);
1643 TestObj& impl = castedThis->impl();
1644 const String& nativeValue(valueToStringWithNullCheck(exec, value));
1645 if (exec->hadException())
1647 impl.setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue);
1651 void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1653 JSValue value = JSValue::decode(encodedValue);
1655 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1657 throwVMTypeError(exec);
1660 TestObj& impl = castedThis->impl();
1661 int nativeValue(toInt32(exec, value, NormalConversion));
1662 if (exec->hadException())
1664 impl.setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, nativeValue);
1668 void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1670 JSValue value = JSValue::decode(encodedValue);
1672 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1674 throwVMTypeError(exec);
1677 TestObj& impl = castedThis->impl();
1678 bool nativeValue(value.toBoolean(exec));
1679 if (exec->hadException())
1681 impl.setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, nativeValue);
1685 void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1687 JSValue value = JSValue::decode(encodedValue);
1689 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1691 throwVMTypeError(exec);
1694 TestObj& impl = castedThis->impl();
1695 const String& nativeValue(valueToStringWithNullCheck(exec, value));
1696 if (exec->hadException())
1698 impl.setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue);
1702 void setJSTestObjTypedArrayAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1704 JSValue value = JSValue::decode(encodedValue);
1706 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1708 throwVMTypeError(exec);
1711 TestObj& impl = castedThis->impl();
1712 RefPtr<Float32Array> nativeValue(toFloat32Array(value));
1713 if (exec->hadException())
1715 impl.setTypedArrayAttr(nativeValue.get());
1719 void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1721 JSValue value = JSValue::decode(encodedValue);
1723 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1725 throwVMTypeError(exec);
1728 TestObj& impl = castedThis->impl();
1729 int nativeValue(toInt32(exec, value, NormalConversion));
1730 if (exec->hadException())
1732 impl.setAttrWithGetterException(nativeValue);
1736 void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1738 JSValue value = JSValue::decode(encodedValue);
1740 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1742 throwVMTypeError(exec);
1745 TestObj& impl = castedThis->impl();
1746 ExceptionCode ec = 0;
1747 int nativeValue(toInt32(exec, value, NormalConversion));
1748 if (exec->hadException())
1750 impl.setAttrWithSetterException(nativeValue, ec);
1751 setDOMException(exec, ec);
1755 void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1757 JSValue value = JSValue::decode(encodedValue);
1759 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1761 throwVMTypeError(exec);
1764 TestObj& impl = castedThis->impl();
1765 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
1766 if (exec->hadException())
1768 impl.setStringAttrWithGetterException(nativeValue);
1772 void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1774 JSValue value = JSValue::decode(encodedValue);
1776 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1778 throwVMTypeError(exec);
1781 TestObj& impl = castedThis->impl();
1782 ExceptionCode ec = 0;
1783 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
1784 if (exec->hadException())
1786 impl.setStringAttrWithSetterException(nativeValue, ec);
1787 setDOMException(exec, ec);
1791 void setJSTestObjCustomAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1793 JSValue value = JSValue::decode(encodedValue);
1795 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1797 throwVMTypeError(exec);
1800 castedThis->setCustomAttr(exec, value);
1804 void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1806 JSValue value = JSValue::decode(encodedValue);
1808 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1810 throwVMTypeError(exec);
1813 TestObj& impl = castedThis->impl();
1814 int nativeValue(toInt32(exec, value, NormalConversion));
1815 if (exec->hadException())
1817 impl.setWithScriptStateAttribute(exec, nativeValue);
1821 void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1823 JSValue value = JSValue::decode(encodedValue);
1825 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1827 throwVMTypeError(exec);
1830 TestObj& impl = castedThis->impl();
1831 TestObj* nativeValue(toTestObj(value));
1832 if (exec->hadException())
1834 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1837 impl.setWithScriptExecutionContextAttribute(scriptContext, nativeValue);
1841 void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1843 JSValue value = JSValue::decode(encodedValue);
1845 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1847 throwVMTypeError(exec);
1850 TestObj& impl = castedThis->impl();
1851 TestObj* nativeValue(toTestObj(value));
1852 if (exec->hadException())
1854 impl.setWithScriptStateAttributeRaises(exec, nativeValue);
1858 void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1860 JSValue value = JSValue::decode(encodedValue);
1862 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1864 throwVMTypeError(exec);
1867 TestObj& impl = castedThis->impl();
1868 TestObj* nativeValue(toTestObj(value));
1869 if (exec->hadException())
1871 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1874 impl.setWithScriptExecutionContextAttributeRaises(scriptContext, nativeValue);
1878 void setJSTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1880 JSValue value = JSValue::decode(encodedValue);
1882 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1884 throwVMTypeError(exec);
1887 TestObj& impl = castedThis->impl();
1888 TestObj* nativeValue(toTestObj(value));
1889 if (exec->hadException())
1891 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1894 impl.setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, nativeValue);
1898 void setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1900 JSValue value = JSValue::decode(encodedValue);
1902 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1904 throwVMTypeError(exec);
1907 TestObj& impl = castedThis->impl();
1908 TestObj* nativeValue(toTestObj(value));
1909 if (exec->hadException())
1911 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1914 impl.setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, nativeValue);
1918 void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1920 JSValue value = JSValue::decode(encodedValue);
1922 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1924 throwVMTypeError(exec);
1927 TestObj& impl = castedThis->impl();
1928 TestObj* nativeValue(toTestObj(value));
1929 if (exec->hadException())
1931 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
1934 impl.setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, nativeValue);
1938 void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1940 JSValue value = JSValue::decode(encodedValue);
1942 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1944 throwVMTypeError(exec);
1947 TestObj& impl = castedThis->impl();
1948 TestObj* nativeValue(toTestObj(value));
1949 if (exec->hadException())
1951 impl.setWithScriptArgumentsAndCallStackAttribute(nativeValue);
1955 #if ENABLE(Condition1)
1956 void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1958 JSValue value = JSValue::decode(encodedValue);
1960 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1962 throwVMTypeError(exec);
1965 TestObj& impl = castedThis->impl();
1966 int nativeValue(toInt32(exec, value, NormalConversion));
1967 if (exec->hadException())
1969 impl.setConditionalAttr1(nativeValue);
1974 #if ENABLE(Condition1) && ENABLE(Condition2)
1975 void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1977 JSValue value = JSValue::decode(encodedValue);
1979 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
1981 throwVMTypeError(exec);
1984 TestObj& impl = castedThis->impl();
1985 int nativeValue(toInt32(exec, value, NormalConversion));
1986 if (exec->hadException())
1988 impl.setConditionalAttr2(nativeValue);
1993 #if ENABLE(Condition1) || ENABLE(Condition2)
1994 void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
1996 JSValue value = JSValue::decode(encodedValue);
1998 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2000 throwVMTypeError(exec);
2003 TestObj& impl = castedThis->impl();
2004 int nativeValue(toInt32(exec, value, NormalConversion));
2005 if (exec->hadException())
2007 impl.setConditionalAttr3(nativeValue);
2012 #if ENABLE(Condition1)
2013 void setJSTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2015 JSValue value = JSValue::decode(encodedValue);
2017 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2019 throwVMTypeError(exec);
2022 // Shadowing a built-in constructor
2023 castedThis->putDirect(exec->vm(), Identifier(exec, "conditionalAttr4"), value);
2028 #if ENABLE(Condition1) && ENABLE(Condition2)
2029 void setJSTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2031 JSValue value = JSValue::decode(encodedValue);
2033 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2035 throwVMTypeError(exec);
2038 // Shadowing a built-in constructor
2039 castedThis->putDirect(exec->vm(), Identifier(exec, "conditionalAttr5"), value);
2044 #if ENABLE(Condition1) || ENABLE(Condition2)
2045 void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2047 JSValue value = JSValue::decode(encodedValue);
2049 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2051 throwVMTypeError(exec);
2054 // Shadowing a built-in constructor
2055 castedThis->putDirect(exec->vm(), Identifier(exec, "conditionalAttr6"), value);
2060 void setJSTestObjAnyAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2062 JSValue value = JSValue::decode(encodedValue);
2064 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2066 throwVMTypeError(exec);
2069 TestObj& impl = castedThis->impl();
2070 Deprecated::ScriptValue nativeValue(exec->vm(), value);
2071 if (exec->hadException())
2073 impl.setAnyAttribute(nativeValue);
2077 void setJSTestObjMutablePoint(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2079 JSValue value = JSValue::decode(encodedValue);
2081 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2083 throwVMTypeError(exec);
2086 TestObj& impl = castedThis->impl();
2087 SVGPropertyTearOff<SVGPoint>* nativeValue(toSVGPoint(value));
2088 if (exec->hadException())
2090 impl.setMutablePoint(nativeValue);
2094 void setJSTestObjImmutablePoint(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2096 JSValue value = JSValue::decode(encodedValue);
2098 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2100 throwVMTypeError(exec);
2103 TestObj& impl = castedThis->impl();
2104 SVGPropertyTearOff<SVGPoint>* nativeValue(toSVGPoint(value));
2105 if (exec->hadException())
2107 impl.setImmutablePoint(nativeValue);
2111 void setJSTestObjStrawberry(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2113 JSValue value = JSValue::decode(encodedValue);
2115 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2117 throwVMTypeError(exec);
2120 TestObj& impl = castedThis->impl();
2121 int nativeValue(toInt32(exec, value, NormalConversion));
2122 if (exec->hadException())
2124 impl.setBlueberry(nativeValue);
2128 void setJSTestObjStrictFloat(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2130 JSValue value = JSValue::decode(encodedValue);
2132 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2134 throwVMTypeError(exec);
2137 TestObj& impl = castedThis->impl();
2138 float nativeValue(value.toFloat(exec));
2139 if (exec->hadException())
2141 impl.setStrictFloat(nativeValue);
2145 void setJSTestObjId(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2147 JSValue value = JSValue::decode(encodedValue);
2149 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2151 throwVMTypeError(exec);
2154 TestObj& impl = castedThis->impl();
2155 int nativeValue(toInt32(exec, value, NormalConversion));
2156 if (exec->hadException())
2158 impl.setId(nativeValue);
2162 void setJSTestObjReplaceableAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2164 JSValue value = JSValue::decode(encodedValue);
2166 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2168 throwVMTypeError(exec);
2171 // Shadowing a built-in object
2172 castedThis->putDirect(exec->vm(), Identifier(exec, "replaceableAttribute"), value);
2176 void setJSTestObjNullableLongSettableAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2178 JSValue value = JSValue::decode(encodedValue);
2180 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2182 throwVMTypeError(exec);
2185 TestObj& impl = castedThis->impl();
2186 int nativeValue(toInt32(exec, value, NormalConversion));
2187 if (exec->hadException())
2189 impl.setNullableLongSettableAttribute(nativeValue);
2193 void setJSTestObjNullableStringValue(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2195 JSValue value = JSValue::decode(encodedValue);
2197 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2199 throwVMTypeError(exec);
2202 TestObj& impl = castedThis->impl();
2203 int nativeValue(toInt32(exec, value, NormalConversion));
2204 if (exec->hadException())
2206 impl.setNullableStringValue(nativeValue);
2210 void setJSTestObjAttributeWithReservedEnumType(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
2212 JSValue value = JSValue::decode(encodedValue);
2214 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
2216 throwVMTypeError(exec);
2219 TestObj& impl = castedThis->impl();
2220 const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
2221 if (exec->hadException())
2223 if (nativeValue != "" && nativeValue != "OptionalValue1" && nativeValue != "OptionalValue2" && nativeValue != "OptionalValue3")
2225 impl.setAttributeWithReservedEnumType(nativeValue);
2229 JSValue JSTestObj::getConstructor(VM& vm, JSGlobalObject* globalObject)
2231 return getDOMConstructor<JSTestObjConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
2234 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec)
2236 JSValue thisValue = exec->hostThisValue();
2237 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2239 return throwVMTypeError(exec);
2240 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2241 TestObj& impl = castedThis->impl();
2243 return JSValue::encode(jsUndefined());
2246 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec)
2248 JSValue thisValue = exec->hostThisValue();
2249 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2251 return throwVMTypeError(exec);
2252 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2253 TestObj& impl = castedThis->impl();
2254 if (exec->argumentCount() < 3)
2255 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2256 int longArg(toInt32(exec, exec->argument(0), NormalConversion));
2257 if (exec->hadException())
2258 return JSValue::encode(jsUndefined());
2259 const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
2260 if (exec->hadException())
2261 return JSValue::encode(jsUndefined());
2262 TestObj* objArg(toTestObj(exec->argument(2)));
2263 if (exec->hadException())
2264 return JSValue::encode(jsUndefined());
2265 impl.voidMethodWithArgs(longArg, strArg, objArg);
2266 return JSValue::encode(jsUndefined());
2269 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionByteMethod(ExecState* exec)
2271 JSValue thisValue = exec->hostThisValue();
2272 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2274 return throwVMTypeError(exec);
2275 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2276 TestObj& impl = castedThis->impl();
2278 JSC::JSValue result = jsNumber(impl.byteMethod());
2279 return JSValue::encode(result);
2282 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionByteMethodWithArgs(ExecState* exec)
2284 JSValue thisValue = exec->hostThisValue();
2285 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2287 return throwVMTypeError(exec);
2288 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2289 TestObj& impl = castedThis->impl();
2290 if (exec->argumentCount() < 3)
2291 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2292 int8_t byteArg(toInt8(exec, exec->argument(0), NormalConversion));
2293 if (exec->hadException())
2294 return JSValue::encode(jsUndefined());
2295 const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
2296 if (exec->hadException())
2297 return JSValue::encode(jsUndefined());
2298 TestObj* objArg(toTestObj(exec->argument(2)));
2299 if (exec->hadException())
2300 return JSValue::encode(jsUndefined());
2302 JSC::JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, objArg));
2303 return JSValue::encode(result);
2306 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOctetMethod(ExecState* exec)
2308 JSValue thisValue = exec->hostThisValue();
2309 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2311 return throwVMTypeError(exec);
2312 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2313 TestObj& impl = castedThis->impl();
2315 JSC::JSValue result = jsNumber(impl.octetMethod());
2316 return JSValue::encode(result);
2319 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOctetMethodWithArgs(ExecState* exec)
2321 JSValue thisValue = exec->hostThisValue();
2322 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2324 return throwVMTypeError(exec);
2325 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2326 TestObj& impl = castedThis->impl();
2327 if (exec->argumentCount() < 3)
2328 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2329 uint8_t octetArg(toUInt8(exec, exec->argument(0), NormalConversion));
2330 if (exec->hadException())
2331 return JSValue::encode(jsUndefined());
2332 const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
2333 if (exec->hadException())
2334 return JSValue::encode(jsUndefined());
2335 TestObj* objArg(toTestObj(exec->argument(2)));
2336 if (exec->hadException())
2337 return JSValue::encode(jsUndefined());
2339 JSC::JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, objArg));
2340 return JSValue::encode(result);
2343 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethod(ExecState* exec)
2345 JSValue thisValue = exec->hostThisValue();
2346 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2348 return throwVMTypeError(exec);
2349 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2350 TestObj& impl = castedThis->impl();
2352 JSC::JSValue result = jsNumber(impl.longMethod());
2353 return JSValue::encode(result);
2356 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethodWithArgs(ExecState* exec)
2358 JSValue thisValue = exec->hostThisValue();
2359 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2361 return throwVMTypeError(exec);
2362 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2363 TestObj& impl = castedThis->impl();
2364 if (exec->argumentCount() < 3)
2365 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2366 int longArg(toInt32(exec, exec->argument(0), NormalConversion));
2367 if (exec->hadException())
2368 return JSValue::encode(jsUndefined());
2369 const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
2370 if (exec->hadException())
2371 return JSValue::encode(jsUndefined());
2372 TestObj* objArg(toTestObj(exec->argument(2)));
2373 if (exec->hadException())
2374 return JSValue::encode(jsUndefined());
2376 JSC::JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, objArg));
2377 return JSValue::encode(result);
2380 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec)
2382 JSValue thisValue = exec->hostThisValue();
2383 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2385 return throwVMTypeError(exec);
2386 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2387 TestObj& impl = castedThis->impl();
2389 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.objMethod()));
2390 return JSValue::encode(result);
2393 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec)
2395 JSValue thisValue = exec->hostThisValue();
2396 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2398 return throwVMTypeError(exec);
2399 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2400 TestObj& impl = castedThis->impl();
2401 if (exec->argumentCount() < 3)
2402 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2403 int longArg(toInt32(exec, exec->argument(0), NormalConversion));
2404 if (exec->hadException())
2405 return JSValue::encode(jsUndefined());
2406 const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
2407 if (exec->hadException())
2408 return JSValue::encode(jsUndefined());
2409 TestObj* objArg(toTestObj(exec->argument(2)));
2410 if (exec->hadException())
2411 return JSValue::encode(jsUndefined());
2413 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, objArg)));
2414 return JSValue::encode(result);
2417 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(ExecState* exec)
2419 JSValue thisValue = exec->hostThisValue();
2420 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2422 return throwVMTypeError(exec);
2423 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2424 TestObj& impl = castedThis->impl();
2425 if (exec->argumentCount() < 1)
2426 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2427 Vector<RefPtr<ScriptProfile> > sequenceArg((toRefPtrNativeArray<ScriptProfile, JSScriptProfile>(exec, exec->argument(0), &toScriptProfile)));
2428 if (exec->hadException())
2429 return JSValue::encode(jsUndefined());
2430 impl.methodWithSequenceArg(sequenceArg);
2431 return JSValue::encode(jsUndefined());
2434 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(ExecState* exec)
2436 JSValue thisValue = exec->hostThisValue();
2437 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2439 return throwVMTypeError(exec);
2440 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2441 TestObj& impl = castedThis->impl();
2442 if (exec->argumentCount() < 1)
2443 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2444 int longArg(toInt32(exec, exec->argument(0), NormalConversion));
2445 if (exec->hadException())
2446 return JSValue::encode(jsUndefined());
2448 JSC::JSValue result = jsArray(exec, castedThis->globalObject(), impl.methodReturningSequence(longArg));
2449 return JSValue::encode(result);
2452 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(ExecState* exec)
2454 JSValue thisValue = exec->hostThisValue();
2455 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2457 return throwVMTypeError(exec);
2458 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2459 TestObj& impl = castedThis->impl();
2460 if (exec->argumentCount() < 1)
2461 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2462 const String enumArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
2463 if (exec->hadException())
2464 return JSValue::encode(jsUndefined());
2465 if (enumArg != "" && enumArg != "EnumValue1" && enumArg != "EnumValue2" && enumArg != "EnumValue3")
2466 return throwVMTypeError(exec);
2467 impl.methodWithEnumArg(enumArg);
2468 return JSValue::encode(jsUndefined());
2471 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec)
2473 JSValue thisValue = exec->hostThisValue();
2474 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2476 return throwVMTypeError(exec);
2477 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2478 TestObj& impl = castedThis->impl();
2479 if (exec->argumentCount() < 2)
2480 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2481 ExceptionCode ec = 0;
2482 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
2483 if (exec->hadException())
2484 return JSValue::encode(jsUndefined());
2485 TestObj* objArg(toTestObj(exec->argument(1)));
2486 if (exec->hadException())
2487 return JSValue::encode(jsUndefined());
2489 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
2490 setDOMException(exec, ec);
2491 return JSValue::encode(result);
2494 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec)
2496 JSValue thisValue = exec->hostThisValue();
2497 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2499 return throwVMTypeError(exec);
2500 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2501 TestObj& impl = castedThis->impl();
2502 if (exec->argumentCount() < 1)
2503 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2504 RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0), 0, 0));
2505 if (exec->hadException())
2506 return JSValue::encode(jsUndefined());
2507 impl.serializedValue(serializedArg);
2508 return JSValue::encode(jsUndefined());
2511 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec)
2513 JSValue thisValue = exec->hostThisValue();
2514 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2516 return throwVMTypeError(exec);
2517 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2518 TestObj& impl = castedThis->impl();
2519 if (exec->argumentCount() < 1)
2520 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2521 Dictionary oo(exec, exec->argument(0));
2522 if (exec->hadException())
2523 return JSValue::encode(jsUndefined());
2524 Dictionary ooo(exec, exec->argument(1));
2525 if (exec->hadException())
2526 return JSValue::encode(jsUndefined());
2527 impl.optionsObject(oo, ooo);
2528 return JSValue::encode(jsUndefined());
2531 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec)
2533 JSValue thisValue = exec->hostThisValue();
2534 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2536 return throwVMTypeError(exec);
2537 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2538 TestObj& impl = castedThis->impl();
2539 ExceptionCode ec = 0;
2540 impl.methodWithException(ec);
2541 setDOMException(exec, ec);
2542 return JSValue::encode(jsUndefined());
2545 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec)
2547 JSValue thisValue = exec->hostThisValue();
2548 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2550 return throwVMTypeError(exec);
2551 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2552 return JSValue::encode(castedThis->customMethod(exec));
2555 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec)
2557 JSValue thisValue = exec->hostThisValue();
2558 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2560 return throwVMTypeError(exec);
2561 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2562 return JSValue::encode(castedThis->customMethodWithArgs(exec));
2565 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec)
2567 JSValue thisValue = exec->hostThisValue();
2568 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2570 return throwVMTypeError(exec);
2571 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2572 TestObj& impl = castedThis->impl();
2573 JSValue listener = exec->argument(1);
2574 if (!listener.isObject())
2575 return JSValue::encode(jsUndefined());
2576 impl.addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
2577 return JSValue::encode(jsUndefined());
2580 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec)
2582 JSValue thisValue = exec->hostThisValue();
2583 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2585 return throwVMTypeError(exec);
2586 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2587 TestObj& impl = castedThis->impl();
2588 JSValue listener = exec->argument(1);
2589 if (!listener.isObject())
2590 return JSValue::encode(jsUndefined());
2591 impl.removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
2592 return JSValue::encode(jsUndefined());
2595 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec)
2597 JSValue thisValue = exec->hostThisValue();
2598 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2600 return throwVMTypeError(exec);
2601 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2602 TestObj& impl = castedThis->impl();
2603 impl.withScriptStateVoid(exec);
2604 return JSValue::encode(jsUndefined());
2607 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec)
2609 JSValue thisValue = exec->hostThisValue();
2610 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2612 return throwVMTypeError(exec);
2613 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2614 TestObj& impl = castedThis->impl();
2616 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptStateObj(exec)));
2617 if (exec->hadException())
2618 return JSValue::encode(jsUndefined());
2619 return JSValue::encode(result);
2622 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec)
2624 JSValue thisValue = exec->hostThisValue();
2625 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2627 return throwVMTypeError(exec);
2628 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2629 TestObj& impl = castedThis->impl();
2630 ExceptionCode ec = 0;
2631 impl.withScriptStateVoidException(exec, ec);
2632 setDOMException(exec, ec);
2633 return JSValue::encode(jsUndefined());
2636 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec)
2638 JSValue thisValue = exec->hostThisValue();
2639 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2641 return throwVMTypeError(exec);
2642 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2643 TestObj& impl = castedThis->impl();
2644 ExceptionCode ec = 0;
2646 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptStateObjException(exec, ec)));
2647 setDOMException(exec, ec);
2648 if (exec->hadException())
2649 return JSValue::encode(jsUndefined());
2650 return JSValue::encode(result);
2653 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
2655 JSValue thisValue = exec->hostThisValue();
2656 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2658 return throwVMTypeError(exec);
2659 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2660 TestObj& impl = castedThis->impl();
2661 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
2663 return JSValue::encode(jsUndefined());
2664 impl.withScriptExecutionContext(scriptContext);
2665 return JSValue::encode(jsUndefined());
2668 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState(ExecState* exec)
2670 JSValue thisValue = exec->hostThisValue();
2671 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2673 return throwVMTypeError(exec);
2674 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2675 TestObj& impl = castedThis->impl();
2676 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
2678 return JSValue::encode(jsUndefined());
2679 impl.withScriptExecutionContextAndScriptState(exec, scriptContext);
2680 return JSValue::encode(jsUndefined());
2683 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException(ExecState* exec)
2685 JSValue thisValue = exec->hostThisValue();
2686 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2688 return throwVMTypeError(exec);
2689 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2690 TestObj& impl = castedThis->impl();
2691 ExceptionCode ec = 0;
2692 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
2694 return JSValue::encode(jsUndefined());
2696 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateObjException(exec, scriptContext, ec)));
2697 setDOMException(exec, ec);
2698 if (exec->hadException())
2699 return JSValue::encode(jsUndefined());
2700 return JSValue::encode(result);
2703 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(ExecState* exec)
2705 JSValue thisValue = exec->hostThisValue();
2706 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2708 return throwVMTypeError(exec);
2709 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2710 TestObj& impl = castedThis->impl();
2711 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
2713 return JSValue::encode(jsUndefined());
2715 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpaces(exec, scriptContext)));
2716 if (exec->hadException())
2717 return JSValue::encode(jsUndefined());
2718 return JSValue::encode(result);
2721 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(ExecState* exec)
2723 JSValue thisValue = exec->hostThisValue();
2724 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2726 return throwVMTypeError(exec);
2727 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2728 TestObj& impl = castedThis->impl();
2729 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0));
2730 impl.withScriptArgumentsAndCallStack(scriptArguments.release());
2731 return JSValue::encode(jsUndefined());
2734 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec)
2736 JSValue thisValue = exec->hostThisValue();
2737 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2739 return throwVMTypeError(exec);
2740 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2741 TestObj& impl = castedThis->impl();
2743 size_t argsCount = exec->argumentCount();
2744 if (argsCount <= 0) {
2745 impl.methodWithOptionalArg();
2746 return JSValue::encode(jsUndefined());
2749 int opt(toInt32(exec, exec->argument(0), NormalConversion));
2750 if (exec->hadException())
2751 return JSValue::encode(jsUndefined());
2752 impl.methodWithOptionalArg(opt);
2753 return JSValue::encode(jsUndefined());
2756 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec)
2758 JSValue thisValue = exec->hostThisValue();
2759 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2761 return throwVMTypeError(exec);
2762 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2763 TestObj& impl = castedThis->impl();
2764 if (exec->argumentCount() < 1)
2765 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2766 int nonOpt(toInt32(exec, exec->argument(0), NormalConversion));
2767 if (exec->hadException())
2768 return JSValue::encode(jsUndefined());
2770 size_t argsCount = exec->argumentCount();
2771 if (argsCount <= 1) {
2772 impl.methodWithNonOptionalArgAndOptionalArg(nonOpt);
2773 return JSValue::encode(jsUndefined());
2776 int opt(toInt32(exec, exec->argument(1), NormalConversion));
2777 if (exec->hadException())
2778 return JSValue::encode(jsUndefined());
2779 impl.methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
2780 return JSValue::encode(jsUndefined());
2783 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec)
2785 JSValue thisValue = exec->hostThisValue();
2786 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2788 return throwVMTypeError(exec);
2789 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2790 TestObj& impl = castedThis->impl();
2791 if (exec->argumentCount() < 1)
2792 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2793 int nonOpt(toInt32(exec, exec->argument(0), NormalConversion));
2794 if (exec->hadException())
2795 return JSValue::encode(jsUndefined());
2797 size_t argsCount = exec->argumentCount();
2798 if (argsCount <= 1) {
2799 impl.methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
2800 return JSValue::encode(jsUndefined());
2803 int opt1(toInt32(exec, exec->argument(1), NormalConversion));
2804 if (exec->hadException())
2805 return JSValue::encode(jsUndefined());
2806 if (argsCount <= 2) {
2807 impl.methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
2808 return JSValue::encode(jsUndefined());
2811 int opt2(toInt32(exec, exec->argument(2), NormalConversion));
2812 if (exec->hadException())
2813 return JSValue::encode(jsUndefined());
2814 impl.methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
2815 return JSValue::encode(jsUndefined());
2818 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(ExecState* exec)
2820 JSValue thisValue = exec->hostThisValue();
2821 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2823 return throwVMTypeError(exec);
2824 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2825 TestObj& impl = castedThis->impl();
2827 size_t argsCount = exec->argumentCount();
2828 if (argsCount <= 0) {
2829 impl.methodWithOptionalString();
2830 return JSValue::encode(jsUndefined());
2833 const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
2834 if (exec->hadException())
2835 return JSValue::encode(jsUndefined());
2836 impl.methodWithOptionalString(str);
2837 return JSValue::encode(jsUndefined());
2840 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(ExecState* exec)
2842 JSValue thisValue = exec->hostThisValue();
2843 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2845 return throwVMTypeError(exec);
2846 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2847 TestObj& impl = castedThis->impl();
2848 const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
2849 if (exec->hadException())
2850 return JSValue::encode(jsUndefined());
2851 impl.methodWithOptionalStringIsUndefined(str);
2852 return JSValue::encode(jsUndefined());
2855 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString(ExecState* exec)
2857 JSValue thisValue = exec->hostThisValue();
2858 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2860 return throwVMTypeError(exec);
2861 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2862 TestObj& impl = castedThis->impl();
2863 const String& str(argumentOrNull(exec, 0).isEmpty() ? String() : argumentOrNull(exec, 0).toString(exec)->value(exec));
2864 if (exec->hadException())
2865 return JSValue::encode(jsUndefined());
2866 impl.methodWithOptionalStringIsNullString(str);
2867 return JSValue::encode(jsUndefined());
2870 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* exec)
2872 JSValue thisValue = exec->hostThisValue();
2873 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2875 return throwVMTypeError(exec);
2876 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2877 TestObj& impl = castedThis->impl();
2878 if (exec->argumentCount() < 1)
2879 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2880 if (!exec->argument(0).isFunction())
2881 return throwVMTypeError(exec);
2882 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject());
2883 impl.methodWithCallbackArg(callback);
2884 return JSValue::encode(jsUndefined());
2887 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec)
2889 JSValue thisValue = exec->hostThisValue();
2890 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2892 return throwVMTypeError(exec);
2893 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2894 TestObj& impl = castedThis->impl();
2895 if (exec->argumentCount() < 2)
2896 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2897 int nonCallback(toInt32(exec, exec->argument(0), NormalConversion));
2898 if (exec->hadException())
2899 return JSValue::encode(jsUndefined());
2900 if (!exec->argument(1).isFunction())
2901 return throwVMTypeError(exec);
2902 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->uncheckedArgument(1)), castedThis->globalObject());
2903 impl.methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
2904 return JSValue::encode(jsUndefined());
2907 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec)
2909 JSValue thisValue = exec->hostThisValue();
2910 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2912 return throwVMTypeError(exec);
2913 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2914 TestObj& impl = castedThis->impl();
2915 RefPtr<TestCallback> callback;
2916 if (!exec->argument(0).isUndefinedOrNull()) {
2917 if (!exec->uncheckedArgument(0).isFunction())
2918 return throwVMTypeError(exec);
2919 callback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject());
2921 impl.methodWithCallbackAndOptionalArg(callback);
2922 return JSValue::encode(jsUndefined());
2925 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg(ExecState* exec)
2927 RefPtr<TestCallback> callback;
2928 if (!exec->argument(0).isUndefinedOrNull()) {
2929 if (!exec->uncheckedArgument(0).isFunction())
2930 return throwVMTypeError(exec);
2931 callback = createFunctionOnlyCallback<JSTestCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument(0));
2933 TestObj::staticMethodWithCallbackAndOptionalArg(callback);
2934 return JSValue::encode(jsUndefined());
2937 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionStaticMethodWithCallbackArg(ExecState* exec)
2939 if (exec->argumentCount() < 1)
2940 return throwVMError(exec, createNotEnoughArgumentsError(exec));
2941 if (!exec->argument(0).isFunction())
2942 return throwVMTypeError(exec);
2943 RefPtr<TestCallback> callback = createFunctionOnlyCallback<JSTestCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument(0));
2944 TestObj::staticMethodWithCallbackArg(callback);
2945 return JSValue::encode(jsUndefined());
2948 #if ENABLE(Condition1)
2949 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod1(ExecState* exec)
2951 JSValue thisValue = exec->hostThisValue();
2952 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2954 return throwVMTypeError(exec);
2955 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2956 TestObj& impl = castedThis->impl();
2958 JSC::JSValue result = jsStringWithCache(exec, impl.conditionalMethod1());
2959 return JSValue::encode(result);
2964 #if ENABLE(Condition1) && ENABLE(Condition2)
2965 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod2(ExecState* exec)
2967 JSValue thisValue = exec->hostThisValue();
2968 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2970 return throwVMTypeError(exec);
2971 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2972 TestObj& impl = castedThis->impl();
2973 impl.conditionalMethod2();
2974 return JSValue::encode(jsUndefined());
2979 #if ENABLE(Condition1) || ENABLE(Condition2)
2980 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod3(ExecState* exec)
2982 JSValue thisValue = exec->hostThisValue();
2983 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2985 return throwVMTypeError(exec);
2986 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
2987 TestObj& impl = castedThis->impl();
2988 impl.conditionalMethod3();
2989 return JSValue::encode(jsUndefined());
2994 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
2996 JSValue thisValue = exec->hostThisValue();
2997 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
2999 return throwVMTypeError(exec);
3000 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3001 TestObj& impl = castedThis->impl();
3002 if (exec->argumentCount() < 2)
3003 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3004 TestObj* objArg(toTestObj(exec->argument(0)));
3005 if (exec->hadException())
3006 return JSValue::encode(jsUndefined());
3007 const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
3008 if (exec->hadException())
3009 return JSValue::encode(jsUndefined());
3010 impl.overloadedMethod(objArg, strArg);
3011 return JSValue::encode(jsUndefined());
3014 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
3016 JSValue thisValue = exec->hostThisValue();
3017 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3019 return throwVMTypeError(exec);
3020 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3021 TestObj& impl = castedThis->impl();
3022 if (exec->argumentCount() < 1)
3023 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3024 TestObj* objArg(toTestObj(exec->argument(0)));
3025 if (exec->hadException())
3026 return JSValue::encode(jsUndefined());
3028 size_t argsCount = exec->argumentCount();
3029 if (argsCount <= 1) {
3030 impl.overloadedMethod(objArg);
3031 return JSValue::encode(jsUndefined());
3034 int longArg(toInt32(exec, exec->argument(1), NormalConversion));
3035 if (exec->hadException())
3036 return JSValue::encode(jsUndefined());
3037 impl.overloadedMethod(objArg, longArg);
3038 return JSValue::encode(jsUndefined());
3041 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
3043 JSValue thisValue = exec->hostThisValue();
3044 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3046 return throwVMTypeError(exec);
3047 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3048 TestObj& impl = castedThis->impl();
3049 if (exec->argumentCount() < 1)
3050 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3051 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
3052 if (exec->hadException())
3053 return JSValue::encode(jsUndefined());
3054 impl.overloadedMethod(strArg);
3055 return JSValue::encode(jsUndefined());
3058 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
3060 JSValue thisValue = exec->hostThisValue();
3061 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3063 return throwVMTypeError(exec);
3064 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3065 TestObj& impl = castedThis->impl();
3066 if (exec->argumentCount() < 1)
3067 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3068 int longArg(toInt32(exec, exec->argument(0), NormalConversion));
3069 if (exec->hadException())
3070 return JSValue::encode(jsUndefined());
3071 impl.overloadedMethod(longArg);
3072 return JSValue::encode(jsUndefined());
3075 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod5(ExecState* exec)
3077 JSValue thisValue = exec->hostThisValue();
3078 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3080 return throwVMTypeError(exec);
3081 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3082 TestObj& impl = castedThis->impl();
3083 if (exec->argumentCount() < 1)
3084 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3085 if (!exec->argument(0).isFunction())
3086 return throwVMTypeError(exec);
3087 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject());
3088 impl.overloadedMethod(callback);
3089 return JSValue::encode(jsUndefined());
3092 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod6(ExecState* exec)
3094 JSValue thisValue = exec->hostThisValue();
3095 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3097 return throwVMTypeError(exec);
3098 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3099 TestObj& impl = castedThis->impl();
3100 if (exec->argumentCount() < 1)
3101 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3102 RefPtr<DOMStringList> listArg(toDOMStringList(exec, exec->argument(0)));
3103 if (exec->hadException())
3104 return JSValue::encode(jsUndefined());
3105 impl.overloadedMethod(listArg);
3106 return JSValue::encode(jsUndefined());
3109 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod7(ExecState* exec)
3111 JSValue thisValue = exec->hostThisValue();
3112 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3114 return throwVMTypeError(exec);
3115 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3116 TestObj& impl = castedThis->impl();
3117 if (exec->argumentCount() < 1)
3118 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3119 Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0)));
3120 if (exec->hadException())
3121 return JSValue::encode(jsUndefined());
3122 impl.overloadedMethod(arrayArg);
3123 return JSValue::encode(jsUndefined());
3126 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod8(ExecState* exec)
3128 JSValue thisValue = exec->hostThisValue();
3129 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3131 return throwVMTypeError(exec);
3132 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3133 TestObj& impl = castedThis->impl();
3134 if (exec->argumentCount() < 1)
3135 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3136 TestObj* objArg(toTestObj(exec->argument(0)));
3137 if (exec->hadException())
3138 return JSValue::encode(jsUndefined());
3139 impl.overloadedMethod(objArg);
3140 return JSValue::encode(jsUndefined());
3143 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod9(ExecState* exec)
3145 JSValue thisValue = exec->hostThisValue();
3146 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3148 return throwVMTypeError(exec);
3149 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3150 TestObj& impl = castedThis->impl();
3151 if (exec->argumentCount() < 1)
3152 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3153 Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0)));
3154 if (exec->hadException())
3155 return JSValue::encode(jsUndefined());
3156 impl.overloadedMethod(arrayArg);
3157 return JSValue::encode(jsUndefined());
3160 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod10(ExecState* exec)
3162 JSValue thisValue = exec->hostThisValue();
3163 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3165 return throwVMTypeError(exec);
3166 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3167 TestObj& impl = castedThis->impl();
3168 if (exec->argumentCount() < 1)
3169 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3170 Vector<unsigned> arrayArg(toNativeArray<unsigned>(exec, exec->argument(0)));
3171 if (exec->hadException())
3172 return JSValue::encode(jsUndefined());
3173 impl.overloadedMethod(arrayArg);
3174 return JSValue::encode(jsUndefined());
3177 static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod11(ExecState* exec)
3179 JSValue thisValue = exec->hostThisValue();
3180 JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
3182 return throwVMTypeError(exec);
3183 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
3184 TestObj& impl = castedThis->impl();
3185 if (exec->argumentCount() < 1)
3186 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3187 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
3188 if (exec->hadException())
3189 return JSValue::encode(jsUndefined());
3190 impl.overloadedMethod(strArg);
3191 return JSValue::encode(jsUndefined());
3194 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
3196 size_t argsCount = exec->argumentCount();
3197 JSValue arg0(exec->argument(0));
3198 JSValue arg1(exec->argument(1));
3199 if ((argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))) && (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject())))
3200 return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
3201 if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))))
3202 return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
3203 if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject())))
3204 return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
3206 return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
3207 if ((argsCount == 1 && (arg0.isNull() || arg0.isFunction())))
3208 return jsTestObjPrototypeFunctionOverloadedMethod5(exec);
3209 if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSDOMStringList::info())))))
3210 return jsTestObjPrototypeFunctionOverloadedMethod6(exec);
3211 if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && isJSArray(arg0)))))
3212 return jsTestObjPrototypeFunctionOverloadedMethod7(exec);
3213 if ((argsCount == 1 && (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))))
3214 return jsTestObjPrototypeFunctionOverloadedMethod8(exec);
3215 if ((argsCount == 1 && (arg0.isObject() && isJSArray(arg0))))
3216 return jsTestObjPrototypeFunctionOverloadedMethod9(exec);
3217 if ((argsCount == 1 && (arg0.isObject() && isJSArray(arg0))))
3218 return jsTestObjPrototypeFunctionOverloadedMethod10(exec);
3220 return jsTestObjPrototypeFunctionOverloadedMethod11(exec);
3222 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3223 return throwVMTypeError(exec);
3226 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(ExecState* exec)
3228 TestObj::classMethod();
3229 return JSValue::encode(jsUndefined());
3232 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional(ExecState* exec)
3235 size_t argsCount = exec->argumentCount();
3236 if (argsCount <= 0) {
3238 JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional());
3239 return JSValue::encode(result);
3242 int arg(toInt32(exec, exec->argument(0), NormalConversion));
3243 if (exec->hadException())
3244 return JSValue::encode(jsUndefined());
3246 JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional(arg));
3247 return JSValue::encode(result);
3250 EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod2(ExecState* exec)
3252 if (exec->argumentCount() < 1)
3253 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3254 return JSValue::encode(JSTestObj::classMethod2(exec));
3257 #if ENABLE(Condition1)
3258 static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod11(ExecState* exec)
3260 if (exec->argumentCount() < 1)
3261 return throwVMError(exec, createNotEnoughArgumentsError(exec));
3262 int arg(toInt32(exec, exec->argument(0), NormalConversion));
3263 if (exec->hadException())
3264 return JSValue::encode(jsUndefined());
3265 TestObj::overloadedMethod1(arg);
3266 return JSValue::encode(jsUndefined());