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