[WebIDL] Remove GetterMayThrowException
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / JS / JSTestTypedefs.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 "JSTestTypedefs.h"
23
24 #include "JSDOMAttribute.h"
25 #include "JSDOMBinding.h"
26 #include "JSDOMConstructor.h"
27 #include "JSDOMConvertBoolean.h"
28 #include "JSDOMConvertBufferSource.h"
29 #include "JSDOMConvertCallbacks.h"
30 #include "JSDOMConvertInterface.h"
31 #include "JSDOMConvertNullable.h"
32 #include "JSDOMConvertNumbers.h"
33 #include "JSDOMConvertSequences.h"
34 #include "JSDOMConvertSerializedScriptValue.h"
35 #include "JSDOMConvertStrings.h"
36 #include "JSDOMConvertUnion.h"
37 #include "JSDOMExceptionHandling.h"
38 #include "JSDOMGlobalObject.h"
39 #include "JSDOMOperation.h"
40 #include "JSDOMWrapperCache.h"
41 #include "JSSVGPoint.h"
42 #include "JSTestCallbackFunction.h"
43 #include "JSTestCallbackInterface.h"
44 #include "JSTestEventTarget.h"
45 #include "JSTestSubObj.h"
46 #include "SerializedScriptValue.h"
47 #include <runtime/FunctionPrototype.h>
48 #include <runtime/JSArray.h>
49 #include <runtime/JSCInlines.h>
50 #include <wtf/GetPtr.h>
51 #include <wtf/Variant.h>
52
53 using namespace JSC;
54
55 namespace WebCore {
56
57 // Functions
58
59 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFunc(JSC::ExecState*);
60 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSetShadow(JSC::ExecState*);
61 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithSequenceArg(JSC::ExecState*);
62 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceArg(JSC::ExecState*);
63 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg(JSC::ExecState*);
64 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg(JSC::ExecState*);
65 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg(JSC::ExecState*);
66 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(JSC::ExecState*);
67 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClamp(JSC::ExecState*);
68 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef(JSC::ExecState*);
69 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionPointFunction(JSC::ExecState*);
70 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction(JSC::ExecState*);
71 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction2(JSC::ExecState*);
72 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude(JSC::ExecState*);
73 JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithException(JSC::ExecState*);
74
75 // Attributes
76
77 JSC::EncodedJSValue jsTestTypedefsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
78 bool setJSTestTypedefsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
79 JSC::EncodedJSValue jsTestTypedefsUnsignedLongLongAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
80 bool setJSTestTypedefsUnsignedLongLongAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
81 JSC::EncodedJSValue jsTestTypedefsSerializedScriptValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
82 bool setJSTestTypedefsSerializedScriptValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
83 JSC::EncodedJSValue jsTestTypedefsConstructorTestSubObj(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
84 JSC::EncodedJSValue jsTestTypedefsAttributeWithClamp(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
85 bool setJSTestTypedefsAttributeWithClamp(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
86 JSC::EncodedJSValue jsTestTypedefsAttributeWithClampInTypedef(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
87 bool setJSTestTypedefsAttributeWithClampInTypedef(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
88 JSC::EncodedJSValue jsTestTypedefsBufferSourceAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
89 bool setJSTestTypedefsBufferSourceAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
90 JSC::EncodedJSValue jsTestTypedefsDomTimeStampAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
91 bool setJSTestTypedefsDomTimeStampAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
92
93 class JSTestTypedefsPrototype : public JSC::JSNonFinalObject {
94 public:
95     using Base = JSC::JSNonFinalObject;
96     static JSTestTypedefsPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
97     {
98         JSTestTypedefsPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestTypedefsPrototype>(vm.heap)) JSTestTypedefsPrototype(vm, globalObject, structure);
99         ptr->finishCreation(vm);
100         return ptr;
101     }
102
103     DECLARE_INFO;
104     static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
105     {
106         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
107     }
108
109 private:
110     JSTestTypedefsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
111         : JSC::JSNonFinalObject(vm, structure)
112     {
113     }
114
115     void finishCreation(JSC::VM&);
116 };
117
118 using JSTestTypedefsConstructor = JSDOMConstructor<JSTestTypedefs>;
119
120 /* Hash table */
121
122 static const struct CompactHashIndex JSTestTypedefsTableIndex[2] = {
123     { -1, -1 },
124     { -1, -1 },
125 };
126
127
128 static const HashTableValue JSTestTypedefsTableValues[] =
129 {
130     { 0, 0, NoIntrinsic, { 0, 0 } }
131 };
132
133 static const HashTable JSTestTypedefsTable = { 0, 1, false, JSTestTypedefs::info(), JSTestTypedefsTableValues, JSTestTypedefsTableIndex };
134 /* Hash table for constructor */
135
136 static const HashTableValue JSTestTypedefsConstructorTableValues[] =
137 {
138     { "TestSubObj", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
139 };
140
141 template<> EncodedJSValue JSC_HOST_CALL JSTestTypedefsConstructor::construct(ExecState* state)
142 {
143     VM& vm = state->vm();
144     auto throwScope = DECLARE_THROW_SCOPE(vm);
145     UNUSED_PARAM(throwScope);
146     auto* castedThis = jsCast<JSTestTypedefsConstructor*>(state->jsCallee());
147     ASSERT(castedThis);
148     if (UNLIKELY(state->argumentCount() < 3))
149         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
150     auto hello = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
151     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
152     auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*state, state->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 1, "testCallbackFunction", "TestTypedefs", nullptr); });
153     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
154     auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(2), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); });
155     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
156     auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull());
157     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestTypedefs>>(*state, *castedThis->globalObject(), WTFMove(object)));
158 }
159
160 template<> JSValue JSTestTypedefsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
161 {
162     UNUSED_PARAM(vm);
163     return globalObject.functionPrototype();
164 }
165
166 template<> void JSTestTypedefsConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
167 {
168     putDirect(vm, vm.propertyNames->prototype, JSTestTypedefs::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
169     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestTypedefs"))), ReadOnly | DontEnum);
170     putDirect(vm, vm.propertyNames->length, jsNumber(3), ReadOnly | DontEnum);
171     reifyStaticProperties(vm, JSTestTypedefs::info(), JSTestTypedefsConstructorTableValues, *this);
172 }
173
174 template<> const ClassInfo JSTestTypedefsConstructor::s_info = { "TestTypedefs", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestTypedefsConstructor) };
175
176 /* Hash table for prototype */
177
178 static const HashTableValue JSTestTypedefsPrototypeTableValues[] =
179 {
180     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsConstructor) } },
181     { "unsignedLongLongAttr", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsUnsignedLongLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsUnsignedLongLongAttr) } },
182     { "serializedScriptValue", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsSerializedScriptValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsSerializedScriptValue) } },
183     { "attributeWithClamp", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsAttributeWithClamp), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsAttributeWithClamp) } },
184     { "attributeWithClampInTypedef", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsAttributeWithClampInTypedef), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsAttributeWithClampInTypedef) } },
185     { "bufferSourceAttr", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsBufferSourceAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsBufferSourceAttr) } },
186     { "domTimeStampAttr", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsDomTimeStampAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestTypedefsDomTimeStampAttr) } },
187     { "func", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionFunc), (intptr_t) (0) } },
188     { "setShadow", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionSetShadow), (intptr_t) (3) } },
189     { "methodWithSequenceArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) } },
190     { "nullableSequenceArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionNullableSequenceArg), (intptr_t) (1) } },
191     { "sequenceOfNullablesArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg), (intptr_t) (1) } },
192     { "nullableSequenceOfNullablesArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg), (intptr_t) (1) } },
193     { "nullableSequenceOfUnionsArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg), (intptr_t) (1) } },
194     { "unionArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionUnionArg), (intptr_t) (1) } },
195     { "funcWithClamp", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionFuncWithClamp), (intptr_t) (1) } },
196     { "funcWithClampInTypedef", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef), (intptr_t) (1) } },
197     { "pointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionPointFunction), (intptr_t) (0) } },
198     { "stringSequenceFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringSequenceFunction), (intptr_t) (1) } },
199     { "stringSequenceFunction2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringSequenceFunction2), (intptr_t) (1) } },
200     { "callWithSequenceThatRequiresInclude", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude), (intptr_t) (1) } },
201     { "methodWithException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionMethodWithException), (intptr_t) (0) } },
202 };
203
204 const ClassInfo JSTestTypedefsPrototype::s_info = { "TestTypedefsPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestTypedefsPrototype) };
205
206 void JSTestTypedefsPrototype::finishCreation(VM& vm)
207 {
208     Base::finishCreation(vm);
209     reifyStaticProperties(vm, JSTestTypedefs::info(), JSTestTypedefsPrototypeTableValues, *this);
210 }
211
212 const ClassInfo JSTestTypedefs::s_info = { "TestTypedefs", &Base::s_info, &JSTestTypedefsTable, nullptr, CREATE_METHOD_TABLE(JSTestTypedefs) };
213
214 JSTestTypedefs::JSTestTypedefs(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestTypedefs>&& impl)
215     : JSDOMWrapper<TestTypedefs>(structure, globalObject, WTFMove(impl))
216 {
217 }
218
219 void JSTestTypedefs::finishCreation(VM& vm)
220 {
221     Base::finishCreation(vm);
222     ASSERT(inherits(vm, info()));
223
224 }
225
226 JSObject* JSTestTypedefs::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
227 {
228     return JSTestTypedefsPrototype::create(vm, &globalObject, JSTestTypedefsPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
229 }
230
231 JSObject* JSTestTypedefs::prototype(VM& vm, JSDOMGlobalObject& globalObject)
232 {
233     return getDOMPrototype<JSTestTypedefs>(vm, globalObject);
234 }
235
236 JSValue JSTestTypedefs::getConstructor(VM& vm, const JSGlobalObject* globalObject)
237 {
238     return getDOMConstructor<JSTestTypedefsConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
239 }
240
241 void JSTestTypedefs::destroy(JSC::JSCell* cell)
242 {
243     JSTestTypedefs* thisObject = static_cast<JSTestTypedefs*>(cell);
244     thisObject->JSTestTypedefs::~JSTestTypedefs();
245 }
246
247 template<> inline JSTestTypedefs* IDLAttribute<JSTestTypedefs>::cast(ExecState& state, EncodedJSValue thisValue)
248 {
249     return jsDynamicDowncast<JSTestTypedefs*>(state.vm(), JSValue::decode(thisValue));
250 }
251
252 template<> inline JSTestTypedefs* IDLOperation<JSTestTypedefs>::cast(ExecState& state)
253 {
254     return jsDynamicDowncast<JSTestTypedefs*>(state.vm(), state.thisValue());
255 }
256
257 EncodedJSValue jsTestTypedefsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
258 {
259     VM& vm = state->vm();
260     auto throwScope = DECLARE_THROW_SCOPE(vm);
261     auto* prototype = jsDynamicDowncast<JSTestTypedefsPrototype*>(vm, JSValue::decode(thisValue));
262     if (UNLIKELY(!prototype))
263         return throwVMTypeError(state, throwScope);
264     return JSValue::encode(JSTestTypedefs::getConstructor(state->vm(), prototype->globalObject()));
265 }
266
267 bool setJSTestTypedefsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
268 {
269     VM& vm = state->vm();
270     auto throwScope = DECLARE_THROW_SCOPE(vm);
271     auto* prototype = jsDynamicDowncast<JSTestTypedefsPrototype*>(vm, JSValue::decode(thisValue));
272     if (UNLIKELY(!prototype)) {
273         throwVMTypeError(state, throwScope);
274         return false;
275     }
276     // Shadowing a built-in constructor
277     return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
278 }
279
280 static inline JSValue jsTestTypedefsUnsignedLongLongAttrGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
281 {
282     UNUSED_PARAM(throwScope);
283     UNUSED_PARAM(state);
284     auto& impl = thisObject.wrapped();
285     JSValue result = toJS<IDLUnsignedLongLong>(state, throwScope, impl.unsignedLongLongAttr());
286     return result;
287 }
288
289 EncodedJSValue jsTestTypedefsUnsignedLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
290 {
291     return IDLAttribute<JSTestTypedefs>::get<jsTestTypedefsUnsignedLongLongAttrGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "unsignedLongLongAttr");
292 }
293
294 static inline bool setJSTestTypedefsUnsignedLongLongAttrSetter(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
295 {
296     UNUSED_PARAM(throwScope);
297     auto& impl = thisObject.wrapped();
298     auto nativeValue = convert<IDLUnsignedLongLong>(state, value);
299     RETURN_IF_EXCEPTION(throwScope, false);
300     AttributeSetter::call(state, throwScope, [&] {
301         return impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
302     });
303     return true;
304 }
305
306 bool setJSTestTypedefsUnsignedLongLongAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
307 {
308     return IDLAttribute<JSTestTypedefs>::set<setJSTestTypedefsUnsignedLongLongAttrSetter>(*state, thisValue, encodedValue, "unsignedLongLongAttr");
309 }
310
311 static inline JSValue jsTestTypedefsSerializedScriptValueGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
312 {
313     UNUSED_PARAM(throwScope);
314     UNUSED_PARAM(state);
315     auto& impl = thisObject.wrapped();
316     JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), throwScope, impl.serializedScriptValue());
317     return result;
318 }
319
320 EncodedJSValue jsTestTypedefsSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
321 {
322     return IDLAttribute<JSTestTypedefs>::get<jsTestTypedefsSerializedScriptValueGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "serializedScriptValue");
323 }
324
325 static inline bool setJSTestTypedefsSerializedScriptValueSetter(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
326 {
327     UNUSED_PARAM(throwScope);
328     auto& impl = thisObject.wrapped();
329     auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value);
330     RETURN_IF_EXCEPTION(throwScope, false);
331     AttributeSetter::call(state, throwScope, [&] {
332         return impl.setSerializedScriptValue(WTFMove(nativeValue));
333     });
334     return true;
335 }
336
337 bool setJSTestTypedefsSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
338 {
339     return IDLAttribute<JSTestTypedefs>::set<setJSTestTypedefsSerializedScriptValueSetter>(*state, thisValue, encodedValue, "serializedScriptValue");
340 }
341
342 static inline JSValue jsTestTypedefsConstructorTestSubObjGetter(ExecState& state, ThrowScope& throwScope)
343 {
344     UNUSED_PARAM(throwScope);
345     UNUSED_PARAM(state);
346     return JSTestSubObj::getConstructor(state.vm(), thisObject.globalObject());
347 }
348
349 EncodedJSValue jsTestTypedefsConstructorTestSubObj(ExecState* state, EncodedJSValue thisValue, PropertyName)
350 {
351     return IDLAttribute<JSTestTypedefs>::getStatic<jsTestTypedefsConstructorTestSubObjGetter>(*state, thisValue, "TestSubObj");
352 }
353
354 static inline JSValue jsTestTypedefsAttributeWithClampGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
355 {
356     UNUSED_PARAM(throwScope);
357     UNUSED_PARAM(state);
358     auto& impl = thisObject.wrapped();
359     JSValue result = toJS<IDLClampAdaptor<IDLUnsignedLongLong>>(state, throwScope, impl.attributeWithClamp());
360     return result;
361 }
362
363 EncodedJSValue jsTestTypedefsAttributeWithClamp(ExecState* state, EncodedJSValue thisValue, PropertyName)
364 {
365     return IDLAttribute<JSTestTypedefs>::get<jsTestTypedefsAttributeWithClampGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "attributeWithClamp");
366 }
367
368 static inline bool setJSTestTypedefsAttributeWithClampSetter(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
369 {
370     UNUSED_PARAM(throwScope);
371     auto& impl = thisObject.wrapped();
372     auto nativeValue = convert<IDLClampAdaptor<IDLUnsignedLongLong>>(state, value);
373     RETURN_IF_EXCEPTION(throwScope, false);
374     AttributeSetter::call(state, throwScope, [&] {
375         return impl.setAttributeWithClamp(WTFMove(nativeValue));
376     });
377     return true;
378 }
379
380 bool setJSTestTypedefsAttributeWithClamp(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
381 {
382     return IDLAttribute<JSTestTypedefs>::set<setJSTestTypedefsAttributeWithClampSetter>(*state, thisValue, encodedValue, "attributeWithClamp");
383 }
384
385 static inline JSValue jsTestTypedefsAttributeWithClampInTypedefGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
386 {
387     UNUSED_PARAM(throwScope);
388     UNUSED_PARAM(state);
389     auto& impl = thisObject.wrapped();
390     JSValue result = toJS<IDLClampAdaptor<IDLLong>>(state, throwScope, impl.attributeWithClampInTypedef());
391     return result;
392 }
393
394 EncodedJSValue jsTestTypedefsAttributeWithClampInTypedef(ExecState* state, EncodedJSValue thisValue, PropertyName)
395 {
396     return IDLAttribute<JSTestTypedefs>::get<jsTestTypedefsAttributeWithClampInTypedefGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "attributeWithClampInTypedef");
397 }
398
399 static inline bool setJSTestTypedefsAttributeWithClampInTypedefSetter(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
400 {
401     UNUSED_PARAM(throwScope);
402     auto& impl = thisObject.wrapped();
403     auto nativeValue = convert<IDLClampAdaptor<IDLLong>>(state, value);
404     RETURN_IF_EXCEPTION(throwScope, false);
405     AttributeSetter::call(state, throwScope, [&] {
406         return impl.setAttributeWithClampInTypedef(WTFMove(nativeValue));
407     });
408     return true;
409 }
410
411 bool setJSTestTypedefsAttributeWithClampInTypedef(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
412 {
413     return IDLAttribute<JSTestTypedefs>::set<setJSTestTypedefsAttributeWithClampInTypedefSetter>(*state, thisValue, encodedValue, "attributeWithClampInTypedef");
414 }
415
416 static inline JSValue jsTestTypedefsBufferSourceAttrGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
417 {
418     UNUSED_PARAM(throwScope);
419     UNUSED_PARAM(state);
420     auto& impl = thisObject.wrapped();
421     JSValue result = toJS<IDLUnion<IDLArrayBufferView, IDLArrayBuffer>>(state, *thisObject.globalObject(), throwScope, impl.bufferSourceAttr());
422     return result;
423 }
424
425 EncodedJSValue jsTestTypedefsBufferSourceAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
426 {
427     return IDLAttribute<JSTestTypedefs>::get<jsTestTypedefsBufferSourceAttrGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "bufferSourceAttr");
428 }
429
430 static inline bool setJSTestTypedefsBufferSourceAttrSetter(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
431 {
432     UNUSED_PARAM(throwScope);
433     auto& impl = thisObject.wrapped();
434     auto nativeValue = convert<IDLUnion<IDLArrayBufferView, IDLArrayBuffer>>(state, value);
435     RETURN_IF_EXCEPTION(throwScope, false);
436     AttributeSetter::call(state, throwScope, [&] {
437         return impl.setBufferSourceAttr(WTFMove(nativeValue));
438     });
439     return true;
440 }
441
442 bool setJSTestTypedefsBufferSourceAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
443 {
444     return IDLAttribute<JSTestTypedefs>::set<setJSTestTypedefsBufferSourceAttrSetter>(*state, thisValue, encodedValue, "bufferSourceAttr");
445 }
446
447 static inline JSValue jsTestTypedefsDomTimeStampAttrGetter(ExecState& state, JSTestTypedefs& thisObject, ThrowScope& throwScope)
448 {
449     UNUSED_PARAM(throwScope);
450     UNUSED_PARAM(state);
451     auto& impl = thisObject.wrapped();
452     JSValue result = toJS<IDLUnsignedLongLong>(state, throwScope, impl.domTimeStampAttr());
453     return result;
454 }
455
456 EncodedJSValue jsTestTypedefsDomTimeStampAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
457 {
458     return IDLAttribute<JSTestTypedefs>::get<jsTestTypedefsDomTimeStampAttrGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "domTimeStampAttr");
459 }
460
461 static inline bool setJSTestTypedefsDomTimeStampAttrSetter(ExecState& state, JSTestTypedefs& thisObject, JSValue value, ThrowScope& throwScope)
462 {
463     UNUSED_PARAM(throwScope);
464     auto& impl = thisObject.wrapped();
465     auto nativeValue = convert<IDLUnsignedLongLong>(state, value);
466     RETURN_IF_EXCEPTION(throwScope, false);
467     AttributeSetter::call(state, throwScope, [&] {
468         return impl.setDomTimeStampAttr(WTFMove(nativeValue));
469     });
470     return true;
471 }
472
473 bool setJSTestTypedefsDomTimeStampAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
474 {
475     return IDLAttribute<JSTestTypedefs>::set<setJSTestTypedefsDomTimeStampAttrSetter>(*state, thisValue, encodedValue, "domTimeStampAttr");
476 }
477
478 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionFuncBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
479 {
480     UNUSED_PARAM(state);
481     UNUSED_PARAM(throwScope);
482     auto& impl = castedThis->wrapped();
483     auto x = state->argument(0).isUndefined() ? Converter<IDLSequence<IDLLong>>::ReturnType{ } : convert<IDLSequence<IDLLong>>(*state, state->uncheckedArgument(0));
484     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
485     impl.func(WTFMove(x));
486     return JSValue::encode(jsUndefined());
487 }
488
489 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFunc(ExecState* state)
490 {
491     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionFuncBody>(*state, "func");
492 }
493
494 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionSetShadowBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
495 {
496     UNUSED_PARAM(state);
497     UNUSED_PARAM(throwScope);
498     auto& impl = castedThis->wrapped();
499     if (UNLIKELY(state->argumentCount() < 3))
500         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
501     auto width = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(0));
502     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
503     auto height = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(1));
504     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
505     auto blur = convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(2));
506     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
507     auto color = state->argument(3).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(3));
508     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
509     auto alpha = state->argument(4).isUndefined() ? std::optional<Converter<IDLUnrestrictedFloat>::ReturnType>() : std::optional<Converter<IDLUnrestrictedFloat>::ReturnType>(convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4)));
510     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
511     impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha));
512     return JSValue::encode(jsUndefined());
513 }
514
515 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSetShadow(ExecState* state)
516 {
517     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionSetShadowBody>(*state, "setShadow");
518 }
519
520 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionMethodWithSequenceArgBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
521 {
522     UNUSED_PARAM(state);
523     UNUSED_PARAM(throwScope);
524     auto& impl = castedThis->wrapped();
525     if (UNLIKELY(state->argumentCount() < 1))
526         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
527     auto sequenceArg = convert<IDLSequence<IDLSerializedScriptValue<SerializedScriptValue>>>(*state, state->uncheckedArgument(0));
528     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
529     return JSValue::encode(toJS<IDLUnsignedLongLong>(impl.methodWithSequenceArg(WTFMove(sequenceArg))));
530 }
531
532 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithSequenceArg(ExecState* state)
533 {
534     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionMethodWithSequenceArgBody>(*state, "methodWithSequenceArg");
535 }
536
537 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionNullableSequenceArgBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
538 {
539     UNUSED_PARAM(state);
540     UNUSED_PARAM(throwScope);
541     auto& impl = castedThis->wrapped();
542     if (UNLIKELY(state->argumentCount() < 1))
543         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
544     auto sequenceArg = convert<IDLNullable<IDLSequence<IDLDOMString>>>(*state, state->uncheckedArgument(0));
545     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
546     impl.nullableSequenceArg(WTFMove(sequenceArg));
547     return JSValue::encode(jsUndefined());
548 }
549
550 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceArg(ExecState* state)
551 {
552     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionNullableSequenceArgBody>(*state, "nullableSequenceArg");
553 }
554
555 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionSequenceOfNullablesArgBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
556 {
557     UNUSED_PARAM(state);
558     UNUSED_PARAM(throwScope);
559     auto& impl = castedThis->wrapped();
560     if (UNLIKELY(state->argumentCount() < 1))
561         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
562     auto sequenceArg = convert<IDLSequence<IDLNullable<IDLDOMString>>>(*state, state->uncheckedArgument(0));
563     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
564     impl.sequenceOfNullablesArg(WTFMove(sequenceArg));
565     return JSValue::encode(jsUndefined());
566 }
567
568 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg(ExecState* state)
569 {
570     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionSequenceOfNullablesArgBody>(*state, "sequenceOfNullablesArg");
571 }
572
573 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArgBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
574 {
575     UNUSED_PARAM(state);
576     UNUSED_PARAM(throwScope);
577     auto& impl = castedThis->wrapped();
578     if (UNLIKELY(state->argumentCount() < 1))
579         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
580     auto sequenceArg = convert<IDLNullable<IDLSequence<IDLNullable<IDLDOMString>>>>(*state, state->uncheckedArgument(0));
581     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
582     impl.nullableSequenceOfNullablesArg(WTFMove(sequenceArg));
583     return JSValue::encode(jsUndefined());
584 }
585
586 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg(ExecState* state)
587 {
588     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArgBody>(*state, "nullableSequenceOfNullablesArg");
589 }
590
591 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
592 {
593     UNUSED_PARAM(state);
594     UNUSED_PARAM(throwScope);
595     auto& impl = castedThis->wrapped();
596     if (UNLIKELY(state->argumentCount() < 1))
597         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
598     auto sequenceArg = convert<IDLNullable<IDLSequence<IDLUnion<IDLDOMString, IDLSequence<IDLDOMString>>>>>(*state, state->uncheckedArgument(0));
599     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
600     impl.nullableSequenceOfUnionsArg(WTFMove(sequenceArg));
601     return JSValue::encode(jsUndefined());
602 }
603
604 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg(ExecState* state)
605 {
606     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgBody>(*state, "nullableSequenceOfUnionsArg");
607 }
608
609 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionUnionArgBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
610 {
611     UNUSED_PARAM(state);
612     UNUSED_PARAM(throwScope);
613     auto& impl = castedThis->wrapped();
614     if (UNLIKELY(state->argumentCount() < 1))
615         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
616     auto unionArg = convert<IDLUnion<IDLDOMString, IDLLong>>(*state, state->uncheckedArgument(0));
617     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
618     impl.unionArg(WTFMove(unionArg));
619     return JSValue::encode(jsUndefined());
620 }
621
622 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(ExecState* state)
623 {
624     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionUnionArgBody>(*state, "unionArg");
625 }
626
627 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionFuncWithClampBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
628 {
629     UNUSED_PARAM(state);
630     UNUSED_PARAM(throwScope);
631     auto& impl = castedThis->wrapped();
632     if (UNLIKELY(state->argumentCount() < 1))
633         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
634     auto arg1 = convert<IDLClampAdaptor<IDLUnsignedLongLong>>(*state, state->uncheckedArgument(0));
635     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
636     auto arg2 = state->argument(1).isUndefined() ? std::optional<Converter<IDLClampAdaptor<IDLUnsignedLongLong>>::ReturnType>() : std::optional<Converter<IDLClampAdaptor<IDLUnsignedLongLong>>::ReturnType>(convert<IDLClampAdaptor<IDLUnsignedLongLong>>(*state, state->uncheckedArgument(1)));
637     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
638     impl.funcWithClamp(WTFMove(arg1), WTFMove(arg2));
639     return JSValue::encode(jsUndefined());
640 }
641
642 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClamp(ExecState* state)
643 {
644     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionFuncWithClampBody>(*state, "funcWithClamp");
645 }
646
647 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
648 {
649     UNUSED_PARAM(state);
650     UNUSED_PARAM(throwScope);
651     auto& impl = castedThis->wrapped();
652     if (UNLIKELY(state->argumentCount() < 1))
653         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
654     auto arg = convert<IDLClampAdaptor<IDLLong>>(*state, state->uncheckedArgument(0));
655     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
656     impl.funcWithClampInTypedef(WTFMove(arg));
657     return JSValue::encode(jsUndefined());
658 }
659
660 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef(ExecState* state)
661 {
662     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefBody>(*state, "funcWithClampInTypedef");
663 }
664
665 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionPointFunctionBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
666 {
667     UNUSED_PARAM(state);
668     UNUSED_PARAM(throwScope);
669     auto& impl = castedThis->wrapped();
670     return JSValue::encode(toJS<IDLInterface<SVGPoint>>(*state, *castedThis->globalObject(), impl.pointFunction()));
671 }
672
673 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionPointFunction(ExecState* state)
674 {
675     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionPointFunctionBody>(*state, "pointFunction");
676 }
677
678 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionStringSequenceFunctionBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
679 {
680     UNUSED_PARAM(state);
681     UNUSED_PARAM(throwScope);
682     auto& impl = castedThis->wrapped();
683     if (UNLIKELY(state->argumentCount() < 1))
684         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
685     auto values = convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
686     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
687     return JSValue::encode(toJS<IDLSequence<IDLDOMString>>(*state, *castedThis->globalObject(), throwScope, impl.stringSequenceFunction(WTFMove(values))));
688 }
689
690 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction(ExecState* state)
691 {
692     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionStringSequenceFunctionBody>(*state, "stringSequenceFunction");
693 }
694
695 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionStringSequenceFunction2Body(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
696 {
697     UNUSED_PARAM(state);
698     UNUSED_PARAM(throwScope);
699     auto& impl = castedThis->wrapped();
700     if (UNLIKELY(state->argumentCount() < 1))
701         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
702     auto values = convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
703     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
704     return JSValue::encode(toJS<IDLSequence<IDLDOMString>>(*state, *castedThis->globalObject(), throwScope, impl.stringSequenceFunction2(WTFMove(values))));
705 }
706
707 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringSequenceFunction2(ExecState* state)
708 {
709     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionStringSequenceFunction2Body>(*state, "stringSequenceFunction2");
710 }
711
712 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresIncludeBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
713 {
714     UNUSED_PARAM(state);
715     UNUSED_PARAM(throwScope);
716     auto& impl = castedThis->wrapped();
717     if (UNLIKELY(state->argumentCount() < 1))
718         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
719     auto sequenceArg = convert<IDLSequence<IDLInterface<TestEventTarget>>>(*state, state->uncheckedArgument(0));
720     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
721     return JSValue::encode(toJS<IDLBoolean>(impl.callWithSequenceThatRequiresInclude(WTFMove(sequenceArg))));
722 }
723
724 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude(ExecState* state)
725 {
726     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresIncludeBody>(*state, "callWithSequenceThatRequiresInclude");
727 }
728
729 static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionMethodWithExceptionBody(JSC::ExecState* state, typename IDLOperation<JSTestTypedefs>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
730 {
731     UNUSED_PARAM(state);
732     UNUSED_PARAM(throwScope);
733     auto& impl = castedThis->wrapped();
734     propagateException(*state, throwScope, impl.methodWithException());
735     return JSValue::encode(jsUndefined());
736 }
737
738 EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithException(ExecState* state)
739 {
740     return IDLOperation<JSTestTypedefs>::call<jsTestTypedefsPrototypeFunctionMethodWithExceptionBody>(*state, "methodWithException");
741 }
742
743 bool JSTestTypedefsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
744 {
745     UNUSED_PARAM(handle);
746     UNUSED_PARAM(visitor);
747     return false;
748 }
749
750 void JSTestTypedefsOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
751 {
752     auto* jsTestTypedefs = static_cast<JSTestTypedefs*>(handle.slot()->asCell());
753     auto& world = *static_cast<DOMWrapperWorld*>(context);
754     uncacheWrapper(world, &jsTestTypedefs->wrapped(), jsTestTypedefs);
755 }
756
757 #if ENABLE(BINDING_INTEGRITY)
758 #if PLATFORM(WIN)
759 #pragma warning(disable: 4483)
760 extern "C" { extern void (*const __identifier("??_7TestTypedefs@WebCore@@6B@")[])(); }
761 #else
762 extern "C" { extern void* _ZTVN7WebCore12TestTypedefsE[]; }
763 #endif
764 #endif
765
766 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestTypedefs>&& impl)
767 {
768
769 #if ENABLE(BINDING_INTEGRITY)
770     void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
771 #if PLATFORM(WIN)
772     void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestTypedefs@WebCore@@6B@"));
773 #else
774     void* expectedVTablePointer = &_ZTVN7WebCore12TestTypedefsE[2];
775 #endif
776
777     // If this fails TestTypedefs does not have a vtable, so you need to add the
778     // ImplementationLacksVTable attribute to the interface definition
779     static_assert(std::is_polymorphic<TestTypedefs>::value, "TestTypedefs is not polymorphic");
780
781     // If you hit this assertion you either have a use after free bug, or
782     // TestTypedefs has subclasses. If TestTypedefs has subclasses that get passed
783     // to toJS() we currently require TestTypedefs you to opt out of binding hardening
784     // by adding the SkipVTableValidation attribute to the interface IDL definition
785     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
786 #endif
787     return createWrapper<TestTypedefs>(globalObject, WTFMove(impl));
788 }
789
790 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestTypedefs& impl)
791 {
792     return wrap(state, globalObject, impl);
793 }
794
795 TestTypedefs* JSTestTypedefs::toWrapped(JSC::VM& vm, JSC::JSValue value)
796 {
797     if (auto* wrapper = jsDynamicDowncast<JSTestTypedefs*>(vm, value))
798         return &wrapper->wrapped();
799     return nullptr;
800 }
801
802 }