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