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