e4bedb504a9915e23d9db36d3a7d675fbb594b6b
[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 encodedJSValue();
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 inline JSTestInterface* JSTestInterface::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
414 {
415     return jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
416 }
417
418 #if ENABLE(Condition22) || ENABLE(Condition23)
419 static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState*);
420
421 EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue, PropertyName)
422 {
423     return JSValue::encode(jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(state));
424 }
425
426 static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState* state)
427 {
428     UNUSED_PARAM(state);
429     JSValue result = jsNumber(TestInterface::implementsStaticReadOnlyAttr());
430     return result;
431 }
432
433 #endif
434
435 #if ENABLE(Condition22) || ENABLE(Condition23)
436 static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState*);
437
438 EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue, PropertyName)
439 {
440     return JSValue::encode(jsTestInterfaceConstructorImplementsStaticAttrGetter(state));
441 }
442
443 static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState* state)
444 {
445     UNUSED_PARAM(state);
446     JSValue result = jsStringWithCache(state, TestInterface::implementsStaticAttr());
447     return result;
448 }
449
450 #endif
451
452 #if ENABLE(Condition22) || ENABLE(Condition23)
453 static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
454
455 EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
456 {
457     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr1Getter>(state, thisValue, "implementsStr1");
458 }
459
460 static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
461 {
462     UNUSED_PARAM(throwScope);
463     UNUSED_PARAM(state);
464     auto& impl = thisObject->wrapped();
465     JSValue result = jsStringWithCache(state, impl.implementsStr1());
466     return result;
467 }
468
469 #endif
470
471 #if ENABLE(Condition22) || ENABLE(Condition23)
472 static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
473
474 EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
475 {
476     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr2Getter>(state, thisValue, "implementsStr2");
477 }
478
479 static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
480 {
481     UNUSED_PARAM(throwScope);
482     UNUSED_PARAM(state);
483     auto& impl = thisObject->wrapped();
484     JSValue result = jsStringWithCache(state, impl.implementsStr2());
485     return result;
486 }
487
488 #endif
489
490 #if ENABLE(Condition22) || ENABLE(Condition23)
491 static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
492
493 EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
494 {
495     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr3Getter>(state, thisValue, "implementsStr3");
496 }
497
498 static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
499 {
500     UNUSED_PARAM(throwScope);
501     UNUSED_PARAM(state);
502     return thisObject->implementsStr3(*state);
503 }
504
505 #endif
506
507 #if ENABLE(Condition22) || ENABLE(Condition23)
508 static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
509
510 EncodedJSValue jsTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, PropertyName)
511 {
512     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsNodeGetter>(state, thisValue, "implementsNode");
513 }
514
515 static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
516 {
517     UNUSED_PARAM(throwScope);
518     UNUSED_PARAM(state);
519     auto& impl = thisObject->wrapped();
520     JSValue result = toJS(state, thisObject->globalObject(), impl.implementsNode());
521     return result;
522 }
523
524 #endif
525
526 #if ENABLE(Condition11) || ENABLE(Condition12)
527 static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState*);
528
529 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue, PropertyName)
530 {
531     return JSValue::encode(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(state));
532 }
533
534 static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState* state)
535 {
536     UNUSED_PARAM(state);
537     JSValue result = jsNumber(WebCore::TestSupplemental::supplementalStaticReadOnlyAttr());
538     return result;
539 }
540
541 #endif
542
543 #if ENABLE(Condition11) || ENABLE(Condition12)
544 static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState*);
545
546 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue, PropertyName)
547 {
548     return JSValue::encode(jsTestInterfaceConstructorSupplementalStaticAttrGetter(state));
549 }
550
551 static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState* state)
552 {
553     UNUSED_PARAM(state);
554     JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStaticAttr());
555     return result;
556 }
557
558 #endif
559
560 #if ENABLE(Condition11) || ENABLE(Condition12)
561 static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
562
563 EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
564 {
565     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr1Getter>(state, thisValue, "supplementalStr1");
566 }
567
568 static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
569 {
570     UNUSED_PARAM(throwScope);
571     UNUSED_PARAM(state);
572     auto& impl = thisObject->wrapped();
573     JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr1(impl));
574     return result;
575 }
576
577 #endif
578
579 #if ENABLE(Condition11) || ENABLE(Condition12)
580 static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
581
582 EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
583 {
584     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr2Getter>(state, thisValue, "supplementalStr2");
585 }
586
587 static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
588 {
589     UNUSED_PARAM(throwScope);
590     UNUSED_PARAM(state);
591     auto& impl = thisObject->wrapped();
592     JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr2(impl));
593     return result;
594 }
595
596 #endif
597
598 #if ENABLE(Condition11) || ENABLE(Condition12)
599 static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
600
601 EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
602 {
603     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr3Getter>(state, thisValue, "supplementalStr3");
604 }
605
606 static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
607 {
608     UNUSED_PARAM(throwScope);
609     UNUSED_PARAM(state);
610     return thisObject->supplementalStr3(*state);
611 }
612
613 #endif
614
615 #if ENABLE(Condition11) || ENABLE(Condition12)
616 static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
617
618 EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, PropertyName)
619 {
620     return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalNodeGetter>(state, thisValue, "supplementalNode");
621 }
622
623 static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
624 {
625     UNUSED_PARAM(throwScope);
626     UNUSED_PARAM(state);
627     auto& impl = thisObject->wrapped();
628     JSValue result = toJS(state, thisObject->globalObject(), WebCore::TestSupplemental::supplementalNode(impl));
629     return result;
630 }
631
632 #endif
633
634 EncodedJSValue jsTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
635 {
636     VM& vm = state->vm();
637     auto throwScope = DECLARE_THROW_SCOPE(vm);
638     JSTestInterfacePrototype* domObject = jsDynamicCast<JSTestInterfacePrototype*>(JSValue::decode(thisValue));
639     if (UNLIKELY(!domObject))
640         return throwVMTypeError(state, throwScope);
641     return JSValue::encode(JSTestInterface::getConstructor(state->vm(), domObject->globalObject()));
642 }
643
644 bool setJSTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
645 {
646     VM& vm = state->vm();
647     auto throwScope = DECLARE_THROW_SCOPE(vm);
648     JSValue value = JSValue::decode(encodedValue);
649     JSTestInterfacePrototype* domObject = jsDynamicCast<JSTestInterfacePrototype*>(JSValue::decode(thisValue));
650     if (UNLIKELY(!domObject)) {
651         throwVMTypeError(state, throwScope);
652         return false;
653     }
654     // Shadowing a built-in constructor
655     return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
656 }
657
658 bool JSTestInterface::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
659 {
660     auto* thisObject = jsCast<JSTestInterface*>(cell);
661     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
662     bool putResult = false;
663     if (thisObject->putDelegate(state, propertyName, value, slot, putResult))
664         return putResult;
665     return Base::put(thisObject, state, propertyName, value, slot);
666 }
667
668 bool JSTestInterface::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
669 {
670     auto* thisObject = jsCast<JSTestInterface*>(cell);
671     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
672     Identifier propertyName = Identifier::from(state, index);
673     PutPropertySlot slot(thisObject, shouldThrow);
674     bool putResult = false;
675     if (thisObject->putDelegate(state, propertyName, value, slot, putResult))
676         return putResult;
677     return Base::putByIndex(cell, state, index, value, shouldThrow);
678 }
679
680 #if ENABLE(Condition22) || ENABLE(Condition23)
681 bool setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
682 {
683     VM& vm = state->vm();
684     auto throwScope = DECLARE_THROW_SCOPE(vm);
685     UNUSED_PARAM(throwScope);
686     JSValue value = JSValue::decode(encodedValue);
687     auto nativeValue = value.toWTFString(state);
688     RETURN_IF_EXCEPTION(throwScope, false);
689     TestInterface::setImplementsStaticAttr(WTFMove(nativeValue));
690     return true;
691 }
692
693 #endif
694
695 #if ENABLE(Condition22) || ENABLE(Condition23)
696 bool setJSTestInterfaceImplementsStr2(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", "implementsStr2");
706     auto& impl = castedThis->wrapped();
707     auto nativeValue = value.toWTFString(state);
708     RETURN_IF_EXCEPTION(throwScope, false);
709     impl.setImplementsStr2(WTFMove(nativeValue));
710     return true;
711 }
712
713 #endif
714
715 #if ENABLE(Condition22) || ENABLE(Condition23)
716 bool setJSTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
717 {
718     VM& vm = state->vm();
719     auto throwScope = DECLARE_THROW_SCOPE(vm);
720     UNUSED_PARAM(throwScope);
721     JSValue value = JSValue::decode(encodedValue);
722     UNUSED_PARAM(thisValue);
723     JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
724     if (UNLIKELY(!castedThis))
725         return throwSetterTypeError(*state, throwScope, "TestInterface", "implementsStr3");
726     castedThis->setImplementsStr3(*state, value);
727     return true;
728 }
729
730 #endif
731
732 #if ENABLE(Condition22) || ENABLE(Condition23)
733 bool setJSTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
734 {
735     VM& vm = state->vm();
736     auto throwScope = DECLARE_THROW_SCOPE(vm);
737     UNUSED_PARAM(throwScope);
738     JSValue value = JSValue::decode(encodedValue);
739     UNUSED_PARAM(thisValue);
740     JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
741     if (UNLIKELY(!castedThis))
742         return throwSetterTypeError(*state, throwScope, "TestInterface", "implementsNode");
743     auto& impl = castedThis->wrapped();
744     auto nativeValue = JSNode::toWrapped(value);
745     if (UNLIKELY(!nativeValue)) {
746         throwAttributeTypeError(*state, throwScope, "TestInterface", "implementsNode", "Node");
747         return false;
748     }
749     impl.setImplementsNode(*nativeValue);
750     return true;
751 }
752
753 #endif
754
755 #if ENABLE(Condition11) || ENABLE(Condition12)
756 bool setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
757 {
758     VM& vm = state->vm();
759     auto throwScope = DECLARE_THROW_SCOPE(vm);
760     UNUSED_PARAM(throwScope);
761     JSValue value = JSValue::decode(encodedValue);
762     auto nativeValue = value.toWTFString(state);
763     RETURN_IF_EXCEPTION(throwScope, false);
764     WebCore::TestSupplemental::setSupplementalStaticAttr(WTFMove(nativeValue));
765     return true;
766 }
767
768 #endif
769
770 #if ENABLE(Condition11) || ENABLE(Condition12)
771 bool setJSTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
772 {
773     VM& vm = state->vm();
774     auto throwScope = DECLARE_THROW_SCOPE(vm);
775     UNUSED_PARAM(throwScope);
776     JSValue value = JSValue::decode(encodedValue);
777     UNUSED_PARAM(thisValue);
778     JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
779     if (UNLIKELY(!castedThis))
780         return throwSetterTypeError(*state, throwScope, "TestInterface", "supplementalStr2");
781     auto& impl = castedThis->wrapped();
782     auto nativeValue = value.toWTFString(state);
783     RETURN_IF_EXCEPTION(throwScope, false);
784     WebCore::TestSupplemental::setSupplementalStr2(impl, WTFMove(nativeValue));
785     return true;
786 }
787
788 #endif
789
790 #if ENABLE(Condition11) || ENABLE(Condition12)
791 bool setJSTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
792 {
793     VM& vm = state->vm();
794     auto throwScope = DECLARE_THROW_SCOPE(vm);
795     UNUSED_PARAM(throwScope);
796     JSValue value = JSValue::decode(encodedValue);
797     UNUSED_PARAM(thisValue);
798     JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
799     if (UNLIKELY(!castedThis))
800         return throwSetterTypeError(*state, throwScope, "TestInterface", "supplementalStr3");
801     castedThis->setSupplementalStr3(*state, value);
802     return true;
803 }
804
805 #endif
806
807 #if ENABLE(Condition11) || ENABLE(Condition12)
808 bool setJSTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
809 {
810     VM& vm = state->vm();
811     auto throwScope = DECLARE_THROW_SCOPE(vm);
812     UNUSED_PARAM(throwScope);
813     JSValue value = JSValue::decode(encodedValue);
814     UNUSED_PARAM(thisValue);
815     JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
816     if (UNLIKELY(!castedThis))
817         return throwSetterTypeError(*state, throwScope, "TestInterface", "supplementalNode");
818     auto& impl = castedThis->wrapped();
819     auto nativeValue = JSNode::toWrapped(value);
820     if (UNLIKELY(!nativeValue)) {
821         throwAttributeTypeError(*state, throwScope, "TestInterface", "supplementalNode", "Node");
822         return false;
823     }
824     WebCore::TestSupplemental::setSupplementalNode(impl, *nativeValue);
825     return true;
826 }
827
828 #endif
829
830 JSValue JSTestInterface::getConstructor(VM& vm, const JSGlobalObject* globalObject)
831 {
832     return getDOMConstructor<JSTestInterfaceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
833 }
834
835 #if ENABLE(Condition22) || ENABLE(Condition23)
836 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(ExecState* state)
837 {
838     VM& vm = state->vm();
839     auto throwScope = DECLARE_THROW_SCOPE(vm);
840     UNUSED_PARAM(throwScope);
841     JSValue thisValue = state->thisValue();
842     auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
843     if (UNLIKELY(!castedThis))
844         return throwThisTypeError(*state, throwScope, "TestInterface", "implementsMethod1");
845     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
846     auto& impl = castedThis->wrapped();
847     impl.implementsMethod1();
848     return JSValue::encode(jsUndefined());
849 }
850
851 #endif
852
853 #if ENABLE(Condition22) || ENABLE(Condition23)
854 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(ExecState* state)
855 {
856     VM& vm = state->vm();
857     auto throwScope = DECLARE_THROW_SCOPE(vm);
858     UNUSED_PARAM(throwScope);
859     JSValue thisValue = state->thisValue();
860     auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
861     if (UNLIKELY(!castedThis))
862         return throwThisTypeError(*state, throwScope, "TestInterface", "implementsMethod2");
863     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
864     auto& impl = castedThis->wrapped();
865     if (UNLIKELY(state->argumentCount() < 2))
866         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
867     ExceptionCode ec = 0;
868     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
869     if (!context)
870         return JSValue::encode(jsUndefined());
871     auto strArg = state->uncheckedArgument(0).toWTFString(state);
872     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
873     auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(1));
874     if (UNLIKELY(!objArg))
875         return throwArgumentTypeError(*state, throwScope, 1, "objArg", "TestInterface", "implementsMethod2", "TestObj");
876     JSValue result = toJS(state, castedThis->globalObject(), impl.implementsMethod2(*context, WTFMove(strArg), *objArg, ec));
877
878     setDOMException(state, throwScope, ec);
879     return JSValue::encode(result);
880 }
881
882 #endif
883
884 #if ENABLE(Condition22) || ENABLE(Condition23)
885 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(ExecState* state)
886 {
887     VM& vm = state->vm();
888     auto throwScope = DECLARE_THROW_SCOPE(vm);
889     UNUSED_PARAM(throwScope);
890     JSValue thisValue = state->thisValue();
891     auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
892     if (UNLIKELY(!castedThis))
893         return throwThisTypeError(*state, throwScope, "TestInterface", "implementsMethod3");
894     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
895     return JSValue::encode(castedThis->implementsMethod3(*state));
896 }
897
898 #endif
899
900 #if ENABLE(Condition22) || ENABLE(Condition23)
901 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(ExecState* state)
902 {
903     VM& vm = state->vm();
904     auto throwScope = DECLARE_THROW_SCOPE(vm);
905     UNUSED_PARAM(throwScope);
906     TestInterface::implementsMethod4();
907     return JSValue::encode(jsUndefined());
908 }
909
910 #endif
911
912 #if ENABLE(Condition11) || ENABLE(Condition12)
913 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(ExecState* state)
914 {
915     VM& vm = state->vm();
916     auto throwScope = DECLARE_THROW_SCOPE(vm);
917     UNUSED_PARAM(throwScope);
918     JSValue thisValue = state->thisValue();
919     auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
920     if (UNLIKELY(!castedThis))
921         return throwThisTypeError(*state, throwScope, "TestInterface", "supplementalMethod1");
922     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
923     auto& impl = castedThis->wrapped();
924     WebCore::TestSupplemental::supplementalMethod1(impl);
925     return JSValue::encode(jsUndefined());
926 }
927
928 #endif
929
930 #if ENABLE(Condition11) || ENABLE(Condition12)
931 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* state)
932 {
933     VM& vm = state->vm();
934     auto throwScope = DECLARE_THROW_SCOPE(vm);
935     UNUSED_PARAM(throwScope);
936     JSValue thisValue = state->thisValue();
937     auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
938     if (UNLIKELY(!castedThis))
939         return throwThisTypeError(*state, throwScope, "TestInterface", "supplementalMethod2");
940     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
941     auto& impl = castedThis->wrapped();
942     if (UNLIKELY(state->argumentCount() < 2))
943         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
944     ExceptionCode ec = 0;
945     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
946     if (!context)
947         return JSValue::encode(jsUndefined());
948     auto strArg = state->uncheckedArgument(0).toWTFString(state);
949     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
950     auto objArg = JSTestObj::toWrapped(state->uncheckedArgument(1));
951     if (UNLIKELY(!objArg))
952         return throwArgumentTypeError(*state, throwScope, 1, "objArg", "TestInterface", "supplementalMethod2", "TestObj");
953     JSValue result = toJS(state, castedThis->globalObject(), WebCore::TestSupplemental::supplementalMethod2(impl, *context, WTFMove(strArg), *objArg, ec));
954
955     setDOMException(state, throwScope, ec);
956     return JSValue::encode(result);
957 }
958
959 #endif
960
961 #if ENABLE(Condition11) || ENABLE(Condition12)
962 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(ExecState* state)
963 {
964     VM& vm = state->vm();
965     auto throwScope = DECLARE_THROW_SCOPE(vm);
966     UNUSED_PARAM(throwScope);
967     JSValue thisValue = state->thisValue();
968     auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
969     if (UNLIKELY(!castedThis))
970         return throwThisTypeError(*state, throwScope, "TestInterface", "supplementalMethod3");
971     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
972     return JSValue::encode(castedThis->supplementalMethod3(*state));
973 }
974
975 #endif
976
977 #if ENABLE(Condition11) || ENABLE(Condition12)
978 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(ExecState* state)
979 {
980     VM& vm = state->vm();
981     auto throwScope = DECLARE_THROW_SCOPE(vm);
982     UNUSED_PARAM(throwScope);
983     WebCore::TestSupplemental::supplementalMethod4();
984     return JSValue::encode(jsUndefined());
985 }
986
987 #endif
988
989 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
990 {
991     auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell());
992     if (jsTestInterface->wrapped().hasPendingActivity())
993         return true;
994     UNUSED_PARAM(visitor);
995     return false;
996 }
997
998 void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
999 {
1000     auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell());
1001     auto& world = *static_cast<DOMWrapperWorld*>(context);
1002     uncacheWrapper(world, &jsTestInterface->wrapped(), jsTestInterface);
1003 }
1004
1005 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestInterface>&& impl)
1006 {
1007 #if COMPILER(CLANG)
1008     // If you hit this failure the interface definition has the ImplementationLacksVTable
1009     // attribute. You should remove that attribute. If the class has subclasses
1010     // that may be passed through this toJS() function you should use the SkipVTableValidation
1011     // attribute to TestInterface.
1012     static_assert(!__is_polymorphic(TestInterface), "TestInterface is polymorphic but the IDL claims it is not");
1013 #endif
1014     return createWrapper<TestInterface>(globalObject, WTFMove(impl));
1015 }
1016
1017 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestInterface& impl)
1018 {
1019     return wrap(state, globalObject, impl);
1020 }
1021
1022 TestInterface* JSTestInterface::toWrapped(JSC::JSValue value)
1023 {
1024     if (auto* wrapper = jsDynamicCast<JSTestInterface*>(value))
1025         return &wrapper->wrapped();
1026     return nullptr;
1027 }
1028
1029 }
1030
1031 #endif // ENABLE(Condition1) || ENABLE(Condition2)