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