[WebIDL] Remove GetterMayThrowException
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / JS / JSTestInterface.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
23 #if ENABLE(Condition1) || ENABLE(Condition2)
24
25 #include "JSTestInterface.h"
26
27 #include "HTMLNames.h"
28 #include "JSDOMAttribute.h"
29 #include "JSDOMBinding.h"
30 #include "JSDOMConstructor.h"
31 #include "JSDOMConvertInterface.h"
32 #include "JSDOMExceptionHandling.h"
33 #include "JSDOMOperation.h"
34 #include "JSDOMWrapperCache.h"
35 #include "TestSupplemental.h"
36 #include <runtime/FunctionPrototype.h>
37 #include <runtime/JSCInlines.h>
38 #include <wtf/GetPtr.h>
39
40 #if ENABLE(Condition1) || ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition2) || ENABLE(Condition22) || ENABLE(Condition23)
41 #include "JSDOMConvertStrings.h"
42 #endif
43
44 #if ENABLE(Condition11) || ENABLE(Condition12)
45 #include "TestSupplementalBuiltins.h"
46 #endif
47
48 #if ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition22) || ENABLE(Condition23)
49 #include "JSDOMConvertNumbers.h"
50 #include "JSDOMGlobalObject.h"
51 #include "JSNode.h"
52 #include "JSTestObj.h"
53 #endif
54
55 using namespace JSC;
56
57 namespace WebCore {
58
59 // Functions
60
61 #if ENABLE(Condition22) || ENABLE(Condition23)
62 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(JSC::ExecState*);
63 #endif
64 #if ENABLE(Condition22) || ENABLE(Condition23)
65 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(JSC::ExecState*);
66 #endif
67 #if ENABLE(Condition22) || ENABLE(Condition23)
68 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(JSC::ExecState*);
69 #endif
70 #if ENABLE(Condition22) || ENABLE(Condition23)
71 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(JSC::ExecState*);
72 #endif
73 #if ENABLE(Condition11) || ENABLE(Condition12)
74 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(JSC::ExecState*);
75 #endif
76 #if ENABLE(Condition11) || ENABLE(Condition12)
77 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(JSC::ExecState*);
78 #endif
79 #if ENABLE(Condition11) || ENABLE(Condition12)
80 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(JSC::ExecState*);
81 #endif
82 #if ENABLE(Condition11) || ENABLE(Condition12)
83 JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(JSC::ExecState*);
84 #endif
85
86 // Attributes
87
88 JSC::EncodedJSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
89 bool setJSTestInterfaceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
90 #if ENABLE(Condition22) || ENABLE(Condition23)
91 JSC::EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
92 #endif
93 #if ENABLE(Condition22) || ENABLE(Condition23)
94 JSC::EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
95 bool setJSTestInterfaceConstructorImplementsStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
96 #endif
97 #if ENABLE(Condition22) || ENABLE(Condition23)
98 JSC::EncodedJSValue jsTestInterfaceImplementsStr1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
99 #endif
100 #if ENABLE(Condition22) || ENABLE(Condition23)
101 JSC::EncodedJSValue jsTestInterfaceImplementsStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
102 bool setJSTestInterfaceImplementsStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
103 #endif
104 #if ENABLE(Condition22) || ENABLE(Condition23)
105 JSC::EncodedJSValue jsTestInterfaceImplementsStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
106 bool setJSTestInterfaceImplementsStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
107 #endif
108 #if ENABLE(Condition22) || ENABLE(Condition23)
109 JSC::EncodedJSValue jsTestInterfaceImplementsNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
110 bool setJSTestInterfaceImplementsNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
111 #endif
112 #if ENABLE(Condition11) || ENABLE(Condition12)
113 JSC::EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
114 #endif
115 #if ENABLE(Condition11) || ENABLE(Condition12)
116 JSC::EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
117 bool setJSTestInterfaceConstructorSupplementalStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
118 #endif
119 #if ENABLE(Condition11) || ENABLE(Condition12)
120 JSC::EncodedJSValue jsTestInterfaceSupplementalStr1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
121 #endif
122 #if ENABLE(Condition11) || ENABLE(Condition12)
123 JSC::EncodedJSValue jsTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
124 bool setJSTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
125 #endif
126 #if ENABLE(Condition11) || ENABLE(Condition12)
127 JSC::EncodedJSValue jsTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
128 bool setJSTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
129 #endif
130 #if ENABLE(Condition11) || ENABLE(Condition12)
131 JSC::EncodedJSValue jsTestInterfaceSupplementalNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
132 bool setJSTestInterfaceSupplementalNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
133 #endif
134 #if ENABLE(Condition11) || ENABLE(Condition12)
135 JSC::EncodedJSValue jsTestInterfaceReflectAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
136 bool setJSTestInterfaceReflectAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
137 #endif
138
139 class JSTestInterfacePrototype : public JSC::JSNonFinalObject {
140 public:
141     using Base = JSC::JSNonFinalObject;
142     static JSTestInterfacePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
143     {
144         JSTestInterfacePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestInterfacePrototype>(vm.heap)) JSTestInterfacePrototype(vm, globalObject, structure);
145         ptr->finishCreation(vm);
146         return ptr;
147     }
148
149     DECLARE_INFO;
150     static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
151     {
152         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
153     }
154
155 private:
156     JSTestInterfacePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
157         : JSC::JSNonFinalObject(vm, structure)
158     {
159     }
160
161     void finishCreation(JSC::VM&);
162 };
163
164 using JSTestInterfaceConstructor = JSDOMConstructor<JSTestInterface>;
165
166 /* Hash table for constructor */
167
168 static const HashTableValue JSTestInterfaceConstructorTableValues[] =
169 {
170 #if ENABLE(Condition22) || ENABLE(Condition23)
171     { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
172 #else
173     { 0, 0, NoIntrinsic, { 0, 0 } },
174 #endif
175 #if ENABLE(Condition22) || ENABLE(Condition23)
176     { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
177 #else
178     { 0, 0, NoIntrinsic, { 0, 0 } },
179 #endif
180 #if ENABLE(Condition11) || ENABLE(Condition12)
181     { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
182 #else
183     { 0, 0, NoIntrinsic, { 0, 0 } },
184 #endif
185 #if ENABLE(Condition11) || ENABLE(Condition12)
186     { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
187 #else
188     { 0, 0, NoIntrinsic, { 0, 0 } },
189 #endif
190 #if ENABLE(Condition22) || ENABLE(Condition23)
191     { "implementsStaticReadOnlyAttr", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
192 #else
193     { 0, 0, NoIntrinsic, { 0, 0 } },
194 #endif
195 #if ENABLE(Condition22) || ENABLE(Condition23)
196     { "implementsStaticAttr", 0, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorImplementsStaticAttr) } },
197 #else
198     { 0, 0, NoIntrinsic, { 0, 0 } },
199 #endif
200 #if ENABLE(Condition11) || ENABLE(Condition12)
201     { "supplementalStaticReadOnlyAttr", ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
202 #else
203     { 0, 0, NoIntrinsic, { 0, 0 } },
204 #endif
205 #if ENABLE(Condition11) || ENABLE(Condition12)
206     { "supplementalStaticAttr", 0, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorSupplementalStaticAttr) } },
207 #else
208     { 0, 0, NoIntrinsic, { 0, 0 } },
209 #endif
210 #if ENABLE(Condition22) || ENABLE(Condition23)
211     { "implementsMethod4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionImplementsMethod4), (intptr_t) (0) } },
212 #else
213     { 0, 0, NoIntrinsic, { 0, 0 } },
214 #endif
215 #if ENABLE(Condition11) || ENABLE(Condition12)
216     { "supplementalMethod4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionSupplementalMethod4), (intptr_t) (0) } },
217 #else
218     { 0, 0, NoIntrinsic, { 0, 0 } },
219 #endif
220 };
221
222 #if ENABLE(Condition22) || ENABLE(Condition23)
223 static_assert(TestInterface::IMPLEMENTSCONSTANT1 == 1, "IMPLEMENTSCONSTANT1 in TestInterface does not match value from IDL");
224 #endif
225 #if ENABLE(Condition22) || ENABLE(Condition23)
226 static_assert(TestInterface::CONST_IMPL == 2, "CONST_IMPL in TestInterface does not match value from IDL");
227 #endif
228 #if ENABLE(Condition11) || ENABLE(Condition12)
229 static_assert(TestSupplemental::SUPPLEMENTALCONSTANT1 == 1, "SUPPLEMENTALCONSTANT1 in TestSupplemental does not match value from IDL");
230 #endif
231 #if ENABLE(Condition11) || ENABLE(Condition12)
232 static_assert(TestSupplemental::CONST_IMPL == 2, "CONST_IMPL in TestSupplemental does not match value from IDL");
233 #endif
234
235 template<> EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::construct(ExecState* state)
236 {
237     VM& vm = state->vm();
238     auto throwScope = DECLARE_THROW_SCOPE(vm);
239     UNUSED_PARAM(throwScope);
240     auto* castedThis = jsCast<JSTestInterfaceConstructor*>(state->jsCallee());
241     ASSERT(castedThis);
242     if (UNLIKELY(state->argumentCount() < 1))
243         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
244     auto* context = castedThis->scriptExecutionContext();
245     if (UNLIKELY(!context))
246         return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, "TestInterface");
247     auto str1 = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
248     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
249     auto str2 = state->argument(1).isUndefined() ? ASCIILiteral("defaultString") : convert<IDLDOMString>(*state, state->uncheckedArgument(1));
250     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
251     auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2));
252     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestInterface>>(*state, *castedThis->globalObject(), throwScope, WTFMove(object)));
253 }
254
255 template<> JSValue JSTestInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
256 {
257     UNUSED_PARAM(vm);
258     return globalObject.functionPrototype();
259 }
260
261 template<> void JSTestInterfaceConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
262 {
263     putDirect(vm, vm.propertyNames->prototype, JSTestInterface::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
264     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestInterface"))), ReadOnly | DontEnum);
265     putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum);
266     reifyStaticProperties(vm, JSTestInterface::info(), JSTestInterfaceConstructorTableValues, *this);
267 }
268
269 template<> const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterface", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestInterfaceConstructor) };
270
271 /* Hash table for prototype */
272
273 static const HashTableValue JSTestInterfacePrototypeTableValues[] =
274 {
275     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructor) } },
276 #if ENABLE(Condition22) || ENABLE(Condition23)
277     { "implementsStr1", ReadOnly | CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
278 #else
279     { 0, 0, NoIntrinsic, { 0, 0 } },
280 #endif
281 #if ENABLE(Condition22) || ENABLE(Condition23)
282     { "implementsStr2", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr2) } },
283 #else
284     { 0, 0, NoIntrinsic, { 0, 0 } },
285 #endif
286 #if ENABLE(Condition22) || ENABLE(Condition23)
287     { "implementsStr3", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr3) } },
288 #else
289     { 0, 0, NoIntrinsic, { 0, 0 } },
290 #endif
291 #if ENABLE(Condition22) || ENABLE(Condition23)
292     { "implementsNode", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsNode) } },
293 #else
294     { 0, 0, NoIntrinsic, { 0, 0 } },
295 #endif
296 #if ENABLE(Condition11) || ENABLE(Condition12)
297     { "supplementalStr1", ReadOnly | CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
298 #else
299     { 0, 0, NoIntrinsic, { 0, 0 } },
300 #endif
301 #if ENABLE(Condition11) || ENABLE(Condition12)
302     { "supplementalStr2", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr2) } },
303 #else
304     { 0, 0, NoIntrinsic, { 0, 0 } },
305 #endif
306 #if ENABLE(Condition11) || ENABLE(Condition12)
307     { "supplementalStr3", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr3) } },
308 #else
309     { 0, 0, NoIntrinsic, { 0, 0 } },
310 #endif
311 #if ENABLE(Condition11) || ENABLE(Condition12)
312     { "supplementalNode", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalNode) } },
313 #else
314     { 0, 0, NoIntrinsic, { 0, 0 } },
315 #endif
316 #if ENABLE(Condition11) || ENABLE(Condition12)
317     { "reflectAttribute", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceReflectAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceReflectAttribute) } },
318 #else
319     { 0, 0, NoIntrinsic, { 0, 0 } },
320 #endif
321 #if ENABLE(Condition11) || ENABLE(Condition12)
322     { "builtinAttribute", Accessor | Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinAttributeCodeGenerator), (intptr_t) (setTestSupplementalBuiltinAttributeCodeGenerator) } },
323 #else
324     { 0, 0, NoIntrinsic, { 0, 0 } },
325 #endif
326 #if ENABLE(Condition22) || ENABLE(Condition23)
327     { "implementsMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } },
328 #else
329     { 0, 0, NoIntrinsic, { 0, 0 } },
330 #endif
331 #if ENABLE(Condition22) || ENABLE(Condition23)
332     { "implementsMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } },
333 #else
334     { 0, 0, NoIntrinsic, { 0, 0 } },
335 #endif
336 #if ENABLE(Condition22) || ENABLE(Condition23)
337     { "implementsMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } },
338 #else
339     { 0, 0, NoIntrinsic, { 0, 0 } },
340 #endif
341 #if ENABLE(Condition11) || ENABLE(Condition12)
342     { "supplementalMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } },
343 #else
344     { 0, 0, NoIntrinsic, { 0, 0 } },
345 #endif
346 #if ENABLE(Condition11) || ENABLE(Condition12)
347     { "supplementalMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } },
348 #else
349     { 0, 0, NoIntrinsic, { 0, 0 } },
350 #endif
351 #if ENABLE(Condition11) || ENABLE(Condition12)
352     { "supplementalMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } },
353 #else
354     { 0, 0, NoIntrinsic, { 0, 0 } },
355 #endif
356 #if ENABLE(Condition11) || ENABLE(Condition12)
357     { "builtinFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } },
358 #else
359     { 0, 0, NoIntrinsic, { 0, 0 } },
360 #endif
361 #if ENABLE(Condition22) || ENABLE(Condition23)
362     { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
363 #else
364     { 0, 0, NoIntrinsic, { 0, 0 } },
365 #endif
366 #if ENABLE(Condition22) || ENABLE(Condition23)
367     { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
368 #else
369     { 0, 0, NoIntrinsic, { 0, 0 } },
370 #endif
371 #if ENABLE(Condition11) || ENABLE(Condition12)
372     { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
373 #else
374     { 0, 0, NoIntrinsic, { 0, 0 } },
375 #endif
376 #if ENABLE(Condition11) || ENABLE(Condition12)
377     { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
378 #else
379     { 0, 0, NoIntrinsic, { 0, 0 } },
380 #endif
381 };
382
383 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestInterfacePrototype) };
384
385 void JSTestInterfacePrototype::finishCreation(VM& vm)
386 {
387     Base::finishCreation(vm);
388     reifyStaticProperties(vm, JSTestInterface::info(), JSTestInterfacePrototypeTableValues, *this);
389 }
390
391 const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestInterface) };
392
393 JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestInterface>&& impl)
394     : JSDOMWrapper<TestInterface>(structure, globalObject, WTFMove(impl))
395 {
396 }
397
398 void JSTestInterface::finishCreation(VM& vm)
399 {
400     Base::finishCreation(vm);
401     ASSERT(inherits(vm, info()));
402
403 }
404
405 JSObject* JSTestInterface::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
406 {
407     return JSTestInterfacePrototype::create(vm, &globalObject, JSTestInterfacePrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
408 }
409
410 JSObject* JSTestInterface::prototype(VM& vm, JSDOMGlobalObject& globalObject)
411 {
412     return getDOMPrototype<JSTestInterface>(vm, globalObject);
413 }
414
415 JSValue JSTestInterface::getConstructor(VM& vm, const JSGlobalObject* globalObject)
416 {
417     return getDOMConstructor<JSTestInterfaceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
418 }
419
420 void JSTestInterface::destroy(JSC::JSCell* cell)
421 {
422     JSTestInterface* thisObject = static_cast<JSTestInterface*>(cell);
423     thisObject->JSTestInterface::~JSTestInterface();
424 }
425
426 template<> inline JSTestInterface* IDLAttribute<JSTestInterface>::cast(ExecState& state, EncodedJSValue thisValue)
427 {
428     return jsDynamicDowncast<JSTestInterface*>(state.vm(), JSValue::decode(thisValue));
429 }
430
431 template<> inline JSTestInterface* IDLOperation<JSTestInterface>::cast(ExecState& state)
432 {
433     return jsDynamicDowncast<JSTestInterface*>(state.vm(), state.thisValue());
434 }
435
436 EncodedJSValue jsTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
437 {
438     VM& vm = state->vm();
439     auto throwScope = DECLARE_THROW_SCOPE(vm);
440     auto* prototype = jsDynamicDowncast<JSTestInterfacePrototype*>(vm, JSValue::decode(thisValue));
441     if (UNLIKELY(!prototype))
442         return throwVMTypeError(state, throwScope);
443     return JSValue::encode(JSTestInterface::getConstructor(state->vm(), prototype->globalObject()));
444 }
445
446 bool setJSTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
447 {
448     VM& vm = state->vm();
449     auto throwScope = DECLARE_THROW_SCOPE(vm);
450     auto* prototype = jsDynamicDowncast<JSTestInterfacePrototype*>(vm, JSValue::decode(thisValue));
451     if (UNLIKELY(!prototype)) {
452         throwVMTypeError(state, throwScope);
453         return false;
454     }
455     // Shadowing a built-in constructor
456     return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
457 }
458
459 #if ENABLE(Condition22) || ENABLE(Condition23)
460 static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState& state, ThrowScope& throwScope)
461 {
462     UNUSED_PARAM(throwScope);
463     UNUSED_PARAM(state);
464     JSValue result = toJS<IDLLong>(state, throwScope, TestInterface::implementsStaticReadOnlyAttr());
465     return result;
466 }
467
468 EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
469 {
470     return IDLAttribute<JSTestInterface>::getStatic<jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter>(*state, thisValue, "implementsStaticReadOnlyAttr");
471 }
472
473 #endif
474
475 #if ENABLE(Condition22) || ENABLE(Condition23)
476 static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState& state, ThrowScope& throwScope)
477 {
478     UNUSED_PARAM(throwScope);
479     UNUSED_PARAM(state);
480     JSValue result = toJS<IDLDOMString>(state, throwScope, TestInterface::implementsStaticAttr());
481     return result;
482 }
483
484 EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
485 {
486     return IDLAttribute<JSTestInterface>::getStatic<jsTestInterfaceConstructorImplementsStaticAttrGetter>(*state, thisValue, "implementsStaticAttr");
487 }
488
489 #endif
490
491 #if ENABLE(Condition22) || ENABLE(Condition23)
492 static inline bool setJSTestInterfaceConstructorImplementsStaticAttrSetter(ExecState& state, JSValue value, ThrowScope& throwScope)
493 {
494     UNUSED_PARAM(throwScope);
495     auto nativeValue = convert<IDLDOMString>(state, value);
496     RETURN_IF_EXCEPTION(throwScope, false);
497     AttributeSetter::call(state, throwScope, [&] {
498         return TestInterface::setImplementsStaticAttr(WTFMove(nativeValue));
499     });
500     return true;
501 }
502
503 bool setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
504 {
505     return IDLAttribute<JSTestInterface>::setStatic<setJSTestInterfaceConstructorImplementsStaticAttrSetter>(*state, thisValue, encodedValue, "implementsStaticAttr");
506 }
507
508 #endif
509
510 #if ENABLE(Condition22) || ENABLE(Condition23)
511 static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
512 {
513     UNUSED_PARAM(throwScope);
514     UNUSED_PARAM(state);
515     auto& impl = thisObject.wrapped();
516     JSValue result = toJS<IDLDOMString>(state, throwScope, impl.implementsStr1());
517     return result;
518 }
519
520 EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
521 {
522     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceImplementsStr1Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "implementsStr1");
523 }
524
525 #endif
526
527 #if ENABLE(Condition22) || ENABLE(Condition23)
528 static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
529 {
530     UNUSED_PARAM(throwScope);
531     UNUSED_PARAM(state);
532     auto& impl = thisObject.wrapped();
533     JSValue result = toJS<IDLDOMString>(state, throwScope, impl.implementsStr2());
534     return result;
535 }
536
537 EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
538 {
539     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceImplementsStr2Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "implementsStr2");
540 }
541
542 #endif
543
544 #if ENABLE(Condition22) || ENABLE(Condition23)
545 static inline bool setJSTestInterfaceImplementsStr2Setter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
546 {
547     UNUSED_PARAM(throwScope);
548     auto& impl = thisObject.wrapped();
549     auto nativeValue = convert<IDLDOMString>(state, value);
550     RETURN_IF_EXCEPTION(throwScope, false);
551     AttributeSetter::call(state, throwScope, [&] {
552         return impl.setImplementsStr2(WTFMove(nativeValue));
553     });
554     return true;
555 }
556
557 bool setJSTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
558 {
559     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceImplementsStr2Setter>(*state, thisValue, encodedValue, "implementsStr2");
560 }
561
562 #endif
563
564 #if ENABLE(Condition22) || ENABLE(Condition23)
565 static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
566 {
567     UNUSED_PARAM(throwScope);
568     UNUSED_PARAM(state);
569     return thisObject.implementsStr3(state);
570 }
571
572 EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
573 {
574     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceImplementsStr3Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "implementsStr3");
575 }
576
577 #endif
578
579 #if ENABLE(Condition22) || ENABLE(Condition23)
580 static inline bool setJSTestInterfaceImplementsStr3Setter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
581 {
582     UNUSED_PARAM(throwScope);
583     thisObject.setImplementsStr3(state, value);
584     return true;
585 }
586
587 bool setJSTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
588 {
589     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceImplementsStr3Setter>(*state, thisValue, encodedValue, "implementsStr3");
590 }
591
592 #endif
593
594 #if ENABLE(Condition22) || ENABLE(Condition23)
595 static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
596 {
597     UNUSED_PARAM(throwScope);
598     UNUSED_PARAM(state);
599     auto& impl = thisObject.wrapped();
600     JSValue result = toJS<IDLInterface<Node>>(state, *thisObject.globalObject(), throwScope, impl.implementsNode());
601     return result;
602 }
603
604 EncodedJSValue jsTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, PropertyName)
605 {
606     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceImplementsNodeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "implementsNode");
607 }
608
609 #endif
610
611 #if ENABLE(Condition22) || ENABLE(Condition23)
612 static inline bool setJSTestInterfaceImplementsNodeSetter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
613 {
614     UNUSED_PARAM(throwScope);
615     auto& impl = thisObject.wrapped();
616     auto nativeValue = convert<IDLInterface<Node>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestInterface", "implementsNode", "Node"); });
617     RETURN_IF_EXCEPTION(throwScope, false);
618     AttributeSetter::call(state, throwScope, [&] {
619         return impl.setImplementsNode(*nativeValue);
620     });
621     return true;
622 }
623
624 bool setJSTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
625 {
626     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceImplementsNodeSetter>(*state, thisValue, encodedValue, "implementsNode");
627 }
628
629 #endif
630
631 #if ENABLE(Condition11) || ENABLE(Condition12)
632 static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState& state, ThrowScope& throwScope)
633 {
634     UNUSED_PARAM(throwScope);
635     UNUSED_PARAM(state);
636     JSValue result = toJS<IDLLong>(state, throwScope, WebCore::TestSupplemental::supplementalStaticReadOnlyAttr());
637     return result;
638 }
639
640 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
641 {
642     return IDLAttribute<JSTestInterface>::getStatic<jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter>(*state, thisValue, "supplementalStaticReadOnlyAttr");
643 }
644
645 #endif
646
647 #if ENABLE(Condition11) || ENABLE(Condition12)
648 static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState& state, ThrowScope& throwScope)
649 {
650     UNUSED_PARAM(throwScope);
651     UNUSED_PARAM(state);
652     JSValue result = toJS<IDLDOMString>(state, throwScope, WebCore::TestSupplemental::supplementalStaticAttr());
653     return result;
654 }
655
656 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
657 {
658     return IDLAttribute<JSTestInterface>::getStatic<jsTestInterfaceConstructorSupplementalStaticAttrGetter>(*state, thisValue, "supplementalStaticAttr");
659 }
660
661 #endif
662
663 #if ENABLE(Condition11) || ENABLE(Condition12)
664 static inline bool setJSTestInterfaceConstructorSupplementalStaticAttrSetter(ExecState& state, JSValue value, ThrowScope& throwScope)
665 {
666     UNUSED_PARAM(throwScope);
667     auto nativeValue = convert<IDLDOMString>(state, value);
668     RETURN_IF_EXCEPTION(throwScope, false);
669     AttributeSetter::call(state, throwScope, [&] {
670         return WebCore::TestSupplemental::setSupplementalStaticAttr(WTFMove(nativeValue));
671     });
672     return true;
673 }
674
675 bool setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
676 {
677     return IDLAttribute<JSTestInterface>::setStatic<setJSTestInterfaceConstructorSupplementalStaticAttrSetter>(*state, thisValue, encodedValue, "supplementalStaticAttr");
678 }
679
680 #endif
681
682 #if ENABLE(Condition11) || ENABLE(Condition12)
683 static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
684 {
685     UNUSED_PARAM(throwScope);
686     UNUSED_PARAM(state);
687     auto& impl = thisObject.wrapped();
688     JSValue result = toJS<IDLDOMString>(state, throwScope, WebCore::TestSupplemental::supplementalStr1(impl));
689     return result;
690 }
691
692 EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
693 {
694     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceSupplementalStr1Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "supplementalStr1");
695 }
696
697 #endif
698
699 #if ENABLE(Condition11) || ENABLE(Condition12)
700 static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
701 {
702     UNUSED_PARAM(throwScope);
703     UNUSED_PARAM(state);
704     auto& impl = thisObject.wrapped();
705     JSValue result = toJS<IDLDOMString>(state, throwScope, WebCore::TestSupplemental::supplementalStr2(impl));
706     return result;
707 }
708
709 EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
710 {
711     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceSupplementalStr2Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "supplementalStr2");
712 }
713
714 #endif
715
716 #if ENABLE(Condition11) || ENABLE(Condition12)
717 static inline bool setJSTestInterfaceSupplementalStr2Setter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
718 {
719     UNUSED_PARAM(throwScope);
720     auto& impl = thisObject.wrapped();
721     auto nativeValue = convert<IDLDOMString>(state, value);
722     RETURN_IF_EXCEPTION(throwScope, false);
723     AttributeSetter::call(state, throwScope, [&] {
724         return WebCore::TestSupplemental::setSupplementalStr2(impl, WTFMove(nativeValue));
725     });
726     return true;
727 }
728
729 bool setJSTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
730 {
731     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceSupplementalStr2Setter>(*state, thisValue, encodedValue, "supplementalStr2");
732 }
733
734 #endif
735
736 #if ENABLE(Condition11) || ENABLE(Condition12)
737 static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
738 {
739     UNUSED_PARAM(throwScope);
740     UNUSED_PARAM(state);
741     return thisObject.supplementalStr3(state);
742 }
743
744 EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
745 {
746     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceSupplementalStr3Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "supplementalStr3");
747 }
748
749 #endif
750
751 #if ENABLE(Condition11) || ENABLE(Condition12)
752 static inline bool setJSTestInterfaceSupplementalStr3Setter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
753 {
754     UNUSED_PARAM(throwScope);
755     thisObject.setSupplementalStr3(state, value);
756     return true;
757 }
758
759 bool setJSTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
760 {
761     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceSupplementalStr3Setter>(*state, thisValue, encodedValue, "supplementalStr3");
762 }
763
764 #endif
765
766 #if ENABLE(Condition11) || ENABLE(Condition12)
767 static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
768 {
769     UNUSED_PARAM(throwScope);
770     UNUSED_PARAM(state);
771     auto& impl = thisObject.wrapped();
772     JSValue result = toJS<IDLInterface<Node>>(state, *thisObject.globalObject(), throwScope, WebCore::TestSupplemental::supplementalNode(impl));
773     return result;
774 }
775
776 EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, PropertyName)
777 {
778     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceSupplementalNodeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "supplementalNode");
779 }
780
781 #endif
782
783 #if ENABLE(Condition11) || ENABLE(Condition12)
784 static inline bool setJSTestInterfaceSupplementalNodeSetter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
785 {
786     UNUSED_PARAM(throwScope);
787     auto& impl = thisObject.wrapped();
788     auto nativeValue = convert<IDLInterface<Node>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestInterface", "supplementalNode", "Node"); });
789     RETURN_IF_EXCEPTION(throwScope, false);
790     AttributeSetter::call(state, throwScope, [&] {
791         return WebCore::TestSupplemental::setSupplementalNode(impl, *nativeValue);
792     });
793     return true;
794 }
795
796 bool setJSTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
797 {
798     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceSupplementalNodeSetter>(*state, thisValue, encodedValue, "supplementalNode");
799 }
800
801 #endif
802
803 #if ENABLE(Condition11) || ENABLE(Condition12)
804 static inline JSValue jsTestInterfaceReflectAttributeGetter(ExecState& state, JSTestInterface& thisObject, ThrowScope& throwScope)
805 {
806     UNUSED_PARAM(throwScope);
807     UNUSED_PARAM(state);
808     auto& impl = thisObject.wrapped();
809     JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::reflectattributeAttr));
810     return result;
811 }
812
813 EncodedJSValue jsTestInterfaceReflectAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
814 {
815     return IDLAttribute<JSTestInterface>::get<jsTestInterfaceReflectAttributeGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "reflectAttribute");
816 }
817
818 #endif
819
820 #if ENABLE(Condition11) || ENABLE(Condition12)
821 static inline bool setJSTestInterfaceReflectAttributeSetter(ExecState& state, JSTestInterface& thisObject, JSValue value, ThrowScope& throwScope)
822 {
823     UNUSED_PARAM(throwScope);
824     auto& impl = thisObject.wrapped();
825     auto nativeValue = convert<IDLDOMString>(state, value);
826     RETURN_IF_EXCEPTION(throwScope, false);
827     AttributeSetter::call(state, throwScope, [&] {
828         return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectattributeAttr, WTFMove(nativeValue));
829     });
830     return true;
831 }
832
833 bool setJSTestInterfaceReflectAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
834 {
835     return IDLAttribute<JSTestInterface>::set<setJSTestInterfaceReflectAttributeSetter>(*state, thisValue, encodedValue, "reflectAttribute");
836 }
837
838 #endif
839
840 #if ENABLE(Condition22) || ENABLE(Condition23)
841 static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunctionImplementsMethod1Body(JSC::ExecState* state, typename IDLOperation<JSTestInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
842 {
843     UNUSED_PARAM(state);
844     UNUSED_PARAM(throwScope);
845     auto& impl = castedThis->wrapped();
846     impl.implementsMethod1();
847     return JSValue::encode(jsUndefined());
848 }
849
850 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(ExecState* state)
851 {
852     return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionImplementsMethod1Body>(*state, "implementsMethod1");
853 }
854
855 #endif
856
857 #if ENABLE(Condition22) || ENABLE(Condition23)
858 static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunctionImplementsMethod2Body(JSC::ExecState* state, typename IDLOperation<JSTestInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
859 {
860     UNUSED_PARAM(state);
861     UNUSED_PARAM(throwScope);
862     auto& impl = castedThis->wrapped();
863     if (UNLIKELY(state->argumentCount() < 2))
864         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
865     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
866     if (UNLIKELY(!context))
867         return JSValue::encode(jsUndefined());
868     auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
869     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
870     auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "objArg", "TestInterface", "implementsMethod2", "TestObj"); });
871     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
872     return JSValue::encode(toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), throwScope, impl.implementsMethod2(*context, WTFMove(strArg), *objArg)));
873 }
874
875 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(ExecState* state)
876 {
877     return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionImplementsMethod2Body>(*state, "implementsMethod2");
878 }
879
880 #endif
881
882 #if ENABLE(Condition22) || ENABLE(Condition23)
883 static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunctionImplementsMethod3Body(JSC::ExecState* state, typename IDLOperation<JSTestInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
884 {
885     UNUSED_PARAM(state);
886     UNUSED_PARAM(throwScope);
887     return JSValue::encode(castedThis->implementsMethod3(*state));
888 }
889
890 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(ExecState* state)
891 {
892     return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionImplementsMethod3Body>(*state, "implementsMethod3");
893 }
894
895 #endif
896
897 #if ENABLE(Condition22) || ENABLE(Condition23)
898 static inline JSC::EncodedJSValue jsTestInterfaceConstructorFunctionImplementsMethod4Body(JSC::ExecState* state, JSC::ThrowScope& throwScope)
899 {
900     UNUSED_PARAM(state);
901     UNUSED_PARAM(throwScope);
902     TestInterface::implementsMethod4();
903     return JSValue::encode(jsUndefined());
904 }
905
906 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(ExecState* state)
907 {
908     return IDLOperation<JSTestInterface>::callStatic<jsTestInterfaceConstructorFunctionImplementsMethod4Body>(*state, "implementsMethod4");
909 }
910
911 #endif
912
913 #if ENABLE(Condition11) || ENABLE(Condition12)
914 static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunctionSupplementalMethod1Body(JSC::ExecState* state, typename IDLOperation<JSTestInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
915 {
916     UNUSED_PARAM(state);
917     UNUSED_PARAM(throwScope);
918     auto& impl = castedThis->wrapped();
919     WebCore::TestSupplemental::supplementalMethod1(impl);
920     return JSValue::encode(jsUndefined());
921 }
922
923 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(ExecState* state)
924 {
925     return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionSupplementalMethod1Body>(*state, "supplementalMethod1");
926 }
927
928 #endif
929
930 #if ENABLE(Condition11) || ENABLE(Condition12)
931 static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunctionSupplementalMethod2Body(JSC::ExecState* state, typename IDLOperation<JSTestInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
932 {
933     UNUSED_PARAM(state);
934     UNUSED_PARAM(throwScope);
935     auto& impl = castedThis->wrapped();
936     if (UNLIKELY(state->argumentCount() < 2))
937         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
938     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
939     if (UNLIKELY(!context))
940         return JSValue::encode(jsUndefined());
941     auto strArg = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
942     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
943     auto objArg = convert<IDLInterface<TestObj>>(*state, state->uncheckedArgument(1), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 1, "objArg", "TestInterface", "supplementalMethod2", "TestObj"); });
944     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
945     return JSValue::encode(toJS<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), throwScope, WebCore::TestSupplemental::supplementalMethod2(impl, *context, WTFMove(strArg), *objArg)));
946 }
947
948 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* state)
949 {
950     return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionSupplementalMethod2Body>(*state, "supplementalMethod2");
951 }
952
953 #endif
954
955 #if ENABLE(Condition11) || ENABLE(Condition12)
956 static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunctionSupplementalMethod3Body(JSC::ExecState* state, typename IDLOperation<JSTestInterface>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
957 {
958     UNUSED_PARAM(state);
959     UNUSED_PARAM(throwScope);
960     return JSValue::encode(castedThis->supplementalMethod3(*state));
961 }
962
963 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(ExecState* state)
964 {
965     return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunctionSupplementalMethod3Body>(*state, "supplementalMethod3");
966 }
967
968 #endif
969
970 #if ENABLE(Condition11) || ENABLE(Condition12)
971 static inline JSC::EncodedJSValue jsTestInterfaceConstructorFunctionSupplementalMethod4Body(JSC::ExecState* state, JSC::ThrowScope& throwScope)
972 {
973     UNUSED_PARAM(state);
974     UNUSED_PARAM(throwScope);
975     WebCore::TestSupplemental::supplementalMethod4();
976     return JSValue::encode(jsUndefined());
977 }
978
979 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(ExecState* state)
980 {
981     return IDLOperation<JSTestInterface>::callStatic<jsTestInterfaceConstructorFunctionSupplementalMethod4Body>(*state, "supplementalMethod4");
982 }
983
984 #endif
985
986 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
987 {
988     auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell());
989     if (jsTestInterface->wrapped().hasPendingActivity())
990         return true;
991     UNUSED_PARAM(visitor);
992     return false;
993 }
994
995 void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
996 {
997     auto* jsTestInterface = static_cast<JSTestInterface*>(handle.slot()->asCell());
998     auto& world = *static_cast<DOMWrapperWorld*>(context);
999     uncacheWrapper(world, &jsTestInterface->wrapped(), jsTestInterface);
1000 }
1001
1002 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestInterface>&& impl)
1003 {
1004     // If you hit this failure the interface definition has the ImplementationLacksVTable
1005     // attribute. You should remove that attribute. If the class has subclasses
1006     // that may be passed through this toJS() function you should use the SkipVTableValidation
1007     // attribute to TestInterface.
1008     static_assert(!std::is_polymorphic<TestInterface>::value, "TestInterface is polymorphic but the IDL claims it is not");
1009     return createWrapper<TestInterface>(globalObject, WTFMove(impl));
1010 }
1011
1012 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestInterface& impl)
1013 {
1014     return wrap(state, globalObject, impl);
1015 }
1016
1017 TestInterface* JSTestInterface::toWrapped(JSC::VM& vm, JSC::JSValue value)
1018 {
1019     if (auto* wrapper = jsDynamicDowncast<JSTestInterface*>(vm, value))
1020         return &wrapper->wrapped();
1021     return nullptr;
1022 }
1023
1024 }
1025
1026 #endif // ENABLE(Condition1) || ENABLE(Condition2)