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