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