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