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