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