2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
23 #if ENABLE(Condition1) || ENABLE(Condition2)
25 #include "JSTestInterface.h"
27 #include "ExceptionCode.h"
28 #include "JSDOMBinding.h"
29 #include "JSTestObj.h"
30 #include "TestInterface.h"
32 #include "TestSupplemental.h"
33 #include <runtime/Error.h>
34 #include <wtf/GetPtr.h>
36 #if ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition22) || ENABLE(Condition23)
39 #include <runtime/JSString.h>
42 #if ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition22) || ENABLE(Condition23)
52 static const HashTableValue JSTestInterfaceTableValues[] =
54 #if ENABLE(Condition22) || ENABLE(Condition23)
55 { "implementsStr1", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
57 #if ENABLE(Condition22) || ENABLE(Condition23)
58 { "implementsStr2", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr2) },
60 #if ENABLE(Condition22) || ENABLE(Condition23)
61 { "implementsStr3", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr3) },
63 #if ENABLE(Condition22) || ENABLE(Condition23)
64 { "implementsNode", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsNode) },
66 #if ENABLE(Condition11) || ENABLE(Condition12)
67 { "supplementalStr1", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
69 #if ENABLE(Condition11) || ENABLE(Condition12)
70 { "supplementalStr2", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr2) },
72 #if ENABLE(Condition11) || ENABLE(Condition12)
73 { "supplementalStr3", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr3) },
75 #if ENABLE(Condition11) || ENABLE(Condition12)
76 { "supplementalNode", DontDelete | CustomAccessor, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalNode) },
78 { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
79 { 0, 0, NoIntrinsic, 0, 0 }
82 static const HashTable JSTestInterfaceTable = { 33, 31, true, JSTestInterfaceTableValues, 0 };
83 /* Hash table for constructor */
85 static const HashTableValue JSTestInterfaceConstructorTableValues[] =
87 #if ENABLE(Condition22) || ENABLE(Condition23)
88 { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceIMPLEMENTSCONSTANT1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
90 #if ENABLE(Condition22) || ENABLE(Condition23)
91 { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceIMPLEMENTSCONSTANT2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
93 #if ENABLE(Condition11) || ENABLE(Condition12)
94 { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
96 #if ENABLE(Condition11) || ENABLE(Condition12)
97 { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
99 #if ENABLE(Condition22) || ENABLE(Condition23)
100 { "implementsStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
102 #if ENABLE(Condition22) || ENABLE(Condition23)
103 { "implementsStaticAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorImplementsStaticAttr) },
105 #if ENABLE(Condition11) || ENABLE(Condition12)
106 { "supplementalStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
108 #if ENABLE(Condition11) || ENABLE(Condition12)
109 { "supplementalStaticAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorSupplementalStaticAttr) },
111 #if ENABLE(Condition22) || ENABLE(Condition23)
112 { "implementsMethod4", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionImplementsMethod4), (intptr_t) (0) },
114 #if ENABLE(Condition11) || ENABLE(Condition12)
115 { "supplementalMethod4", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionSupplementalMethod4), (intptr_t) (0) },
117 { 0, 0, NoIntrinsic, 0, 0 }
120 static const HashTable JSTestInterfaceConstructorTable = { 11, 7, true, JSTestInterfaceConstructorTableValues, 0 };
122 #if ENABLE(Condition22) || ENABLE(Condition23)
123 COMPILE_ASSERT(1 == TestInterface::IMPLEMENTSCONSTANT1, TestInterfaceEnumIMPLEMENTSCONSTANT1IsWrongUseDoNotCheckConstants);
125 #if ENABLE(Condition22) || ENABLE(Condition23)
126 COMPILE_ASSERT(2 == TestInterface::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
128 #if ENABLE(Condition11) || ENABLE(Condition12)
129 COMPILE_ASSERT(1 == TestSupplemental::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSUPPLEMENTALCONSTANT1IsWrongUseDoNotCheckConstants);
131 #if ENABLE(Condition11) || ENABLE(Condition12)
132 COMPILE_ASSERT(2 == TestSupplemental::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
135 EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* exec)
137 JSTestInterfaceConstructor* castedThis = jsCast<JSTestInterfaceConstructor*>(exec->callee());
138 if (exec->argumentCount() < 1)
139 return throwVMError(exec, createNotEnoughArgumentsError(exec));
140 ExceptionCode ec = 0;
141 const String& str1(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
142 if (exec->hadException())
143 return JSValue::encode(jsUndefined());
144 const String& str2(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
145 if (exec->hadException())
146 return JSValue::encode(jsUndefined());
147 ScriptExecutionContext* context = castedThis->scriptExecutionContext();
149 return throwVMError(exec, createReferenceError(exec, "TestInterface constructor associated document is unavailable"));
150 RefPtr<TestInterface> object = TestInterface::create(*context, str1, str2, ec);
152 setDOMException(exec, ec);
153 return JSValue::encode(JSValue());
155 return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
158 const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", &Base::s_info, &JSTestInterfaceConstructorTable, 0, CREATE_METHOD_TABLE(JSTestInterfaceConstructor) };
160 JSTestInterfaceConstructor::JSTestInterfaceConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
161 : DOMConstructorObject(structure, globalObject)
165 void JSTestInterfaceConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
167 Base::finishCreation(vm);
168 ASSERT(inherits(info()));
169 putDirect(vm, vm.propertyNames->prototype, JSTestInterfacePrototype::self(vm, globalObject), DontDelete | ReadOnly);
170 putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
173 bool JSTestInterfaceConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
175 return getStaticPropertySlot<JSTestInterfaceConstructor, JSDOMWrapper>(exec, JSTestInterfaceConstructorTable, jsCast<JSTestInterfaceConstructor*>(object), propertyName, slot);
178 #if ENABLE(TEST_INTERFACE)
179 ConstructType JSTestInterfaceConstructor::getConstructData(JSCell*, ConstructData& constructData)
181 constructData.native.function = constructJSTestInterface;
182 return ConstructTypeHost;
184 #endif // ENABLE(TEST_INTERFACE)
186 /* Hash table for prototype */
188 static const HashTableValue JSTestInterfacePrototypeTableValues[] =
190 #if ENABLE(Condition22) || ENABLE(Condition23)
191 { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceIMPLEMENTSCONSTANT1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
193 #if ENABLE(Condition22) || ENABLE(Condition23)
194 { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceIMPLEMENTSCONSTANT2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
196 #if ENABLE(Condition11) || ENABLE(Condition12)
197 { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
199 #if ENABLE(Condition11) || ENABLE(Condition12)
200 { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
202 #if ENABLE(Condition22) || ENABLE(Condition23)
203 { "implementsMethod1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) },
205 #if ENABLE(Condition22) || ENABLE(Condition23)
206 { "implementsMethod2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) },
208 #if ENABLE(Condition22) || ENABLE(Condition23)
209 { "implementsMethod3", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) },
211 #if ENABLE(Condition11) || ENABLE(Condition12)
212 { "supplementalMethod1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) },
214 #if ENABLE(Condition11) || ENABLE(Condition12)
215 { "supplementalMethod2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) },
217 #if ENABLE(Condition11) || ENABLE(Condition12)
218 { "supplementalMethod3", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) },
220 { 0, 0, NoIntrinsic, 0, 0 }
223 static const HashTable JSTestInterfacePrototypeTable = { 34, 31, true, JSTestInterfacePrototypeTableValues, 0 };
224 const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &Base::s_info, &JSTestInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestInterfacePrototype) };
226 JSObject* JSTestInterfacePrototype::self(VM& vm, JSGlobalObject* globalObject)
228 return getDOMPrototype<JSTestInterface>(vm, globalObject);
231 bool JSTestInterfacePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
233 JSTestInterfacePrototype* thisObject = jsCast<JSTestInterfacePrototype*>(object);
234 return getStaticPropertySlot<JSTestInterfacePrototype, JSObject>(exec, JSTestInterfacePrototypeTable, thisObject, propertyName, slot);
237 const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, &JSTestInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestInterface) };
239 JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
240 : JSDOMWrapper(structure, globalObject)
241 , m_impl(impl.leakRef())
245 void JSTestInterface::finishCreation(VM& vm)
247 Base::finishCreation(vm);
248 ASSERT(inherits(info()));
251 JSObject* JSTestInterface::createPrototype(VM& vm, JSGlobalObject* globalObject)
253 return JSTestInterfacePrototype::create(vm, globalObject, JSTestInterfacePrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
256 void JSTestInterface::destroy(JSC::JSCell* cell)
258 JSTestInterface* thisObject = static_cast<JSTestInterface*>(cell);
259 thisObject->JSTestInterface::~JSTestInterface();
262 JSTestInterface::~JSTestInterface()
264 releaseImplIfNotNull();
267 bool JSTestInterface::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
269 JSTestInterface* thisObject = jsCast<JSTestInterface*>(object);
270 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
271 return getStaticValueSlot<JSTestInterface, Base>(exec, JSTestInterfaceTable, thisObject, propertyName, slot);
274 #if ENABLE(Condition22) || ENABLE(Condition23)
275 EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
277 UNUSED_PARAM(thisValue);
278 UNUSED_PARAM(slotBase);
280 JSValue result = jsNumber(TestInterface::implementsStaticReadOnlyAttr());
281 return JSValue::encode(result);
286 #if ENABLE(Condition22) || ENABLE(Condition23)
287 EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
289 UNUSED_PARAM(thisValue);
290 UNUSED_PARAM(slotBase);
292 JSValue result = jsStringWithCache(exec, TestInterface::implementsStaticAttr());
293 return JSValue::encode(result);
298 #if ENABLE(Condition22) || ENABLE(Condition23)
299 EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
301 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
302 UNUSED_PARAM(slotBase);
304 return throwVMTypeError(exec);
306 TestInterface& impl = castedThis->impl();
307 JSValue result = jsStringWithCache(exec, impl.implementsStr1());
308 return JSValue::encode(result);
313 #if ENABLE(Condition22) || ENABLE(Condition23)
314 EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
316 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
317 UNUSED_PARAM(slotBase);
319 return throwVMTypeError(exec);
321 TestInterface& impl = castedThis->impl();
322 JSValue result = jsStringWithCache(exec, impl.implementsStr2());
323 return JSValue::encode(result);
328 #if ENABLE(Condition22) || ENABLE(Condition23)
329 EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
331 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
332 UNUSED_PARAM(slotBase);
334 return throwVMTypeError(exec);
335 return JSValue::encode(castedThis->implementsStr3(exec));
340 #if ENABLE(Condition22) || ENABLE(Condition23)
341 EncodedJSValue jsTestInterfaceImplementsNode(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
343 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
344 UNUSED_PARAM(slotBase);
346 return throwVMTypeError(exec);
348 TestInterface& impl = castedThis->impl();
349 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsNode()));
350 return JSValue::encode(result);
355 #if ENABLE(Condition11) || ENABLE(Condition12)
356 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
358 UNUSED_PARAM(thisValue);
359 UNUSED_PARAM(slotBase);
361 JSValue result = jsNumber(TestSupplemental::supplementalStaticReadOnlyAttr());
362 return JSValue::encode(result);
367 #if ENABLE(Condition11) || ENABLE(Condition12)
368 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
370 UNUSED_PARAM(thisValue);
371 UNUSED_PARAM(slotBase);
373 JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStaticAttr());
374 return JSValue::encode(result);
379 #if ENABLE(Condition11) || ENABLE(Condition12)
380 EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
382 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
383 UNUSED_PARAM(slotBase);
385 return throwVMTypeError(exec);
387 TestInterface& impl = castedThis->impl();
388 JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr1(&impl));
389 return JSValue::encode(result);
394 #if ENABLE(Condition11) || ENABLE(Condition12)
395 EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
397 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
398 UNUSED_PARAM(slotBase);
400 return throwVMTypeError(exec);
402 TestInterface& impl = castedThis->impl();
403 JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr2(&impl));
404 return JSValue::encode(result);
409 #if ENABLE(Condition11) || ENABLE(Condition12)
410 EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
412 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
413 UNUSED_PARAM(slotBase);
415 return throwVMTypeError(exec);
416 return JSValue::encode(castedThis->supplementalStr3(exec));
421 #if ENABLE(Condition11) || ENABLE(Condition12)
422 EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
424 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
425 UNUSED_PARAM(slotBase);
427 return throwVMTypeError(exec);
429 TestInterface& impl = castedThis->impl();
430 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalNode(&impl)));
431 return JSValue::encode(result);
436 EncodedJSValue jsTestInterfaceConstructor(ExecState* exec, JSObject*, EncodedJSValue thisValue, PropertyName)
438 JSTestInterface* domObject = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
440 return throwVMTypeError(exec);
441 return JSValue::encode(JSTestInterface::getConstructor(exec->vm(), domObject->globalObject()));
444 void JSTestInterface::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
446 JSTestInterface* thisObject = jsCast<JSTestInterface*>(cell);
447 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
448 if (thisObject->putDelegate(exec, propertyName, value, slot))
450 Base::put(thisObject, exec, propertyName, value, slot);
453 void JSTestInterface::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)
455 JSTestInterface* thisObject = jsCast<JSTestInterface*>(cell);
456 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
457 PropertyName propertyName = Identifier::from(exec, index);
458 PutPropertySlot slot(thisObject, shouldThrow);
459 if (thisObject->putDelegate(exec, propertyName, value, slot))
461 Base::putByIndex(cell, exec, index, value, shouldThrow);
464 #if ENABLE(Condition22) || ENABLE(Condition23)
465 void setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue, EncodedJSValue encodedValue)
467 JSValue value = JSValue::decode(encodedValue);
469 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
470 if (exec->hadException())
472 TestInterface::setImplementsStaticAttr(nativeValue);
477 #if ENABLE(Condition22) || ENABLE(Condition23)
478 void setJSTestInterfaceImplementsStr2(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
480 JSValue value = JSValue::decode(encodedValue);
482 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
484 throwVMTypeError(exec);
487 TestInterface& impl = castedThis->impl();
488 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
489 if (exec->hadException())
491 impl.setImplementsStr2(nativeValue);
496 #if ENABLE(Condition22) || ENABLE(Condition23)
497 void setJSTestInterfaceImplementsStr3(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
499 JSValue value = JSValue::decode(encodedValue);
501 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
503 throwVMTypeError(exec);
506 castedThis->setImplementsStr3(exec, value);
511 #if ENABLE(Condition22) || ENABLE(Condition23)
512 void setJSTestInterfaceImplementsNode(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
514 JSValue value = JSValue::decode(encodedValue);
516 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
518 throwVMTypeError(exec);
521 TestInterface& impl = castedThis->impl();
522 Node* nativeValue(toNode(value));
523 if (exec->hadException())
525 impl.setImplementsNode(nativeValue);
530 #if ENABLE(Condition11) || ENABLE(Condition12)
531 void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue, EncodedJSValue encodedValue)
533 JSValue value = JSValue::decode(encodedValue);
535 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
536 if (exec->hadException())
538 TestSupplemental::setSupplementalStaticAttr(nativeValue);
543 #if ENABLE(Condition11) || ENABLE(Condition12)
544 void setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
546 JSValue value = JSValue::decode(encodedValue);
548 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
550 throwVMTypeError(exec);
553 TestInterface& impl = castedThis->impl();
554 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
555 if (exec->hadException())
557 TestSupplemental::setSupplementalStr2(&impl, nativeValue);
562 #if ENABLE(Condition11) || ENABLE(Condition12)
563 void setJSTestInterfaceSupplementalStr3(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
565 JSValue value = JSValue::decode(encodedValue);
567 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
569 throwVMTypeError(exec);
572 castedThis->setSupplementalStr3(exec, value);
577 #if ENABLE(Condition11) || ENABLE(Condition12)
578 void setJSTestInterfaceSupplementalNode(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
580 JSValue value = JSValue::decode(encodedValue);
582 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
584 throwVMTypeError(exec);
587 TestInterface& impl = castedThis->impl();
588 Node* nativeValue(toNode(value));
589 if (exec->hadException())
591 TestSupplemental::setSupplementalNode(&impl, nativeValue);
596 JSValue JSTestInterface::getConstructor(VM& vm, JSGlobalObject* globalObject)
598 return getDOMConstructor<JSTestInterfaceConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
601 #if ENABLE(Condition22) || ENABLE(Condition23)
602 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(ExecState* exec)
604 JSValue thisValue = exec->hostThisValue();
605 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
607 return throwVMTypeError(exec);
608 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
609 TestInterface& impl = castedThis->impl();
610 impl.implementsMethod1();
611 return JSValue::encode(jsUndefined());
616 #if ENABLE(Condition22) || ENABLE(Condition23)
617 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(ExecState* exec)
619 JSValue thisValue = exec->hostThisValue();
620 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
622 return throwVMTypeError(exec);
623 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
624 TestInterface& impl = castedThis->impl();
625 if (exec->argumentCount() < 2)
626 return throwVMError(exec, createNotEnoughArgumentsError(exec));
627 ExceptionCode ec = 0;
628 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
630 return JSValue::encode(jsUndefined());
631 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
632 if (exec->hadException())
633 return JSValue::encode(jsUndefined());
634 TestObj* objArg(toTestObj(exec->argument(1)));
635 if (exec->hadException())
636 return JSValue::encode(jsUndefined());
638 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(scriptContext, strArg, objArg, ec)));
639 setDOMException(exec, ec);
640 return JSValue::encode(result);
645 #if ENABLE(Condition22) || ENABLE(Condition23)
646 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(ExecState* exec)
648 JSValue thisValue = exec->hostThisValue();
649 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
651 return throwVMTypeError(exec);
652 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
653 return JSValue::encode(castedThis->implementsMethod3(exec));
658 #if ENABLE(Condition22) || ENABLE(Condition23)
659 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(ExecState* exec)
661 TestInterface::implementsMethod4();
662 return JSValue::encode(jsUndefined());
667 #if ENABLE(Condition11) || ENABLE(Condition12)
668 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(ExecState* exec)
670 JSValue thisValue = exec->hostThisValue();
671 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
673 return throwVMTypeError(exec);
674 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
675 TestInterface& impl = castedThis->impl();
676 TestSupplemental::supplementalMethod1(&impl);
677 return JSValue::encode(jsUndefined());
682 #if ENABLE(Condition11) || ENABLE(Condition12)
683 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* exec)
685 JSValue thisValue = exec->hostThisValue();
686 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
688 return throwVMTypeError(exec);
689 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
690 TestInterface& impl = castedThis->impl();
691 if (exec->argumentCount() < 2)
692 return throwVMError(exec, createNotEnoughArgumentsError(exec));
693 ExceptionCode ec = 0;
694 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
696 return JSValue::encode(jsUndefined());
697 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
698 if (exec->hadException())
699 return JSValue::encode(jsUndefined());
700 TestObj* objArg(toTestObj(exec->argument(1)));
701 if (exec->hadException())
702 return JSValue::encode(jsUndefined());
704 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(&impl, scriptContext, strArg, objArg, ec)));
705 setDOMException(exec, ec);
706 return JSValue::encode(result);
711 #if ENABLE(Condition11) || ENABLE(Condition12)
712 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(ExecState* exec)
714 JSValue thisValue = exec->hostThisValue();
715 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
717 return throwVMTypeError(exec);
718 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
719 return JSValue::encode(castedThis->supplementalMethod3(exec));
724 #if ENABLE(Condition11) || ENABLE(Condition12)
725 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(ExecState* exec)
727 TestSupplemental::supplementalMethod4();
728 return JSValue::encode(jsUndefined());
735 #if ENABLE(Condition22) || ENABLE(Condition23)
736 EncodedJSValue jsTestInterfaceIMPLEMENTSCONSTANT1(ExecState* exec, JSObject*, EncodedJSValue, PropertyName)
739 return JSValue::encode(jsNumber(static_cast<int>(1)));
743 #if ENABLE(Condition22) || ENABLE(Condition23)
744 EncodedJSValue jsTestInterfaceIMPLEMENTSCONSTANT2(ExecState* exec, JSObject*, EncodedJSValue, PropertyName)
747 return JSValue::encode(jsNumber(static_cast<int>(2)));
751 #if ENABLE(Condition11) || ENABLE(Condition12)
752 EncodedJSValue jsTestInterfaceSUPPLEMENTALCONSTANT1(ExecState* exec, JSObject*, EncodedJSValue, PropertyName)
755 return JSValue::encode(jsNumber(static_cast<int>(1)));
759 #if ENABLE(Condition11) || ENABLE(Condition12)
760 EncodedJSValue jsTestInterfaceSUPPLEMENTALCONSTANT2(ExecState* exec, JSObject*, EncodedJSValue, PropertyName)
763 return JSValue::encode(jsNumber(static_cast<int>(2)));
767 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
769 JSTestInterface* jsTestInterface = jsCast<JSTestInterface*>(handle.get().asCell());
770 if (jsTestInterface->impl().hasPendingActivity())
772 UNUSED_PARAM(visitor);
776 void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
778 JSTestInterface* jsTestInterface = jsCast<JSTestInterface*>(handle.get().asCell());
779 DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
780 uncacheWrapper(world, &jsTestInterface->impl(), jsTestInterface);
781 jsTestInterface->releaseImpl();
784 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInterface* impl)
788 if (JSValue result = getExistingWrapper<JSTestInterface>(exec, impl))
791 // If you hit this failure the interface definition has the ImplementationLacksVTable
792 // attribute. You should remove that attribute. If the class has subclasses
793 // that may be passed through this toJS() function you should use the SkipVTableValidation
794 // attribute to TestInterface.
795 COMPILE_ASSERT(!__is_polymorphic(TestInterface), TestInterface_is_polymorphic_but_idl_claims_not_to_be);
797 ReportMemoryCost<TestInterface>::reportMemoryCost(exec, impl);
798 return createNewWrapper<JSTestInterface>(exec, globalObject, impl);
801 TestInterface* toTestInterface(JSC::JSValue value)
803 return value.inherits(JSTestInterface::info()) ? &jsCast<JSTestInterface*>(value)->impl() : 0;
808 #endif // ENABLE(Condition1) || ENABLE(Condition2)