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