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, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr1), (intptr_t)0 },
57 #if ENABLE(Condition22) || ENABLE(Condition23)
58 { "implementsStr2", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr2), (intptr_t)setJSTestInterfaceImplementsStr2 },
60 #if ENABLE(Condition22) || ENABLE(Condition23)
61 { "implementsStr3", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr3), (intptr_t)setJSTestInterfaceImplementsStr3 },
63 #if ENABLE(Condition22) || ENABLE(Condition23)
64 { "implementsNode", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsNode), (intptr_t)setJSTestInterfaceImplementsNode },
66 #if ENABLE(Condition11) || ENABLE(Condition12)
67 { "supplementalStr1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr1), (intptr_t)0 },
69 #if ENABLE(Condition11) || ENABLE(Condition12)
70 { "supplementalStr2", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr2), (intptr_t)setJSTestInterfaceSupplementalStr2 },
72 #if ENABLE(Condition11) || ENABLE(Condition12)
73 { "supplementalStr3", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t)setJSTestInterfaceSupplementalStr3 },
75 #if ENABLE(Condition11) || ENABLE(Condition12)
76 { "supplementalNode", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalNode), (intptr_t)setJSTestInterfaceSupplementalNode },
78 { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t)0 },
79 { 0, 0, NoIntrinsic, 0, 0 }
82 static const HashTable JSTestInterfaceTable = { 33, 31, 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)0 },
90 #if ENABLE(Condition22) || ENABLE(Condition23)
91 { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceIMPLEMENTSCONSTANT2), (intptr_t)0 },
93 #if ENABLE(Condition11) || ENABLE(Condition12)
94 { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT1), (intptr_t)0 },
96 #if ENABLE(Condition11) || ENABLE(Condition12)
97 { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT2), (intptr_t)0 },
99 #if ENABLE(Condition22) || ENABLE(Condition23)
100 { "implementsStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticReadOnlyAttr), (intptr_t)0 },
102 #if ENABLE(Condition22) || ENABLE(Condition23)
103 { "implementsStaticAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticAttr), (intptr_t)setJSTestInterfaceConstructorImplementsStaticAttr },
105 #if ENABLE(Condition11) || ENABLE(Condition12)
106 { "supplementalStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr), (intptr_t)0 },
108 #if ENABLE(Condition11) || ENABLE(Condition12)
109 { "supplementalStaticAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticAttr), (intptr_t)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, 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)0 },
193 #if ENABLE(Condition22) || ENABLE(Condition23)
194 { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceIMPLEMENTSCONSTANT2), (intptr_t)0 },
196 #if ENABLE(Condition11) || ENABLE(Condition12)
197 { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT1), (intptr_t)0 },
199 #if ENABLE(Condition11) || ENABLE(Condition12)
200 { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSUPPLEMENTALCONSTANT2), (intptr_t)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, 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, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
277 UNUSED_PARAM(slotBase);
279 JSValue result = jsNumber(TestInterface::implementsStaticReadOnlyAttr());
280 return JSValue::encode(result);
285 #if ENABLE(Condition22) || ENABLE(Condition23)
286 EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
288 UNUSED_PARAM(slotBase);
290 JSValue result = jsStringWithCache(exec, TestInterface::implementsStaticAttr());
291 return JSValue::encode(result);
296 #if ENABLE(Condition22) || ENABLE(Condition23)
297 EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
299 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
301 TestInterface& impl = castedThis->impl();
302 JSValue result = jsStringWithCache(exec, impl.implementsStr1());
303 return JSValue::encode(result);
308 #if ENABLE(Condition22) || ENABLE(Condition23)
309 EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
311 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
313 TestInterface& impl = castedThis->impl();
314 JSValue result = jsStringWithCache(exec, impl.implementsStr2());
315 return JSValue::encode(result);
320 #if ENABLE(Condition22) || ENABLE(Condition23)
321 EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
323 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
324 return JSValue::encode(castedThis->implementsStr3(exec));
329 #if ENABLE(Condition22) || ENABLE(Condition23)
330 EncodedJSValue jsTestInterfaceImplementsNode(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
332 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
334 TestInterface& impl = castedThis->impl();
335 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsNode()));
336 return JSValue::encode(result);
341 #if ENABLE(Condition11) || ENABLE(Condition12)
342 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
344 UNUSED_PARAM(slotBase);
346 JSValue result = jsNumber(TestSupplemental::supplementalStaticReadOnlyAttr());
347 return JSValue::encode(result);
352 #if ENABLE(Condition11) || ENABLE(Condition12)
353 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
355 UNUSED_PARAM(slotBase);
357 JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStaticAttr());
358 return JSValue::encode(result);
363 #if ENABLE(Condition11) || ENABLE(Condition12)
364 EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
366 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
368 TestInterface& impl = castedThis->impl();
369 JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr1(&impl));
370 return JSValue::encode(result);
375 #if ENABLE(Condition11) || ENABLE(Condition12)
376 EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
378 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
380 TestInterface& impl = castedThis->impl();
381 JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr2(&impl));
382 return JSValue::encode(result);
387 #if ENABLE(Condition11) || ENABLE(Condition12)
388 EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
390 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
391 return JSValue::encode(castedThis->supplementalStr3(exec));
396 #if ENABLE(Condition11) || ENABLE(Condition12)
397 EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
399 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
401 TestInterface& impl = castedThis->impl();
402 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalNode(&impl)));
403 return JSValue::encode(result);
408 EncodedJSValue jsTestInterfaceConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
410 JSTestInterface* domObject = jsDynamicCast<JSTestInterface*>(JSValue::decode(slotBase));
411 return JSValue::encode(JSTestInterface::getConstructor(exec->vm(), domObject->globalObject()));
414 void JSTestInterface::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
416 JSTestInterface* thisObject = jsCast<JSTestInterface*>(cell);
417 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
418 if (thisObject->putDelegate(exec, propertyName, value, slot))
420 lookupPut<JSTestInterface, Base>(exec, propertyName, value, JSTestInterfaceTable, thisObject, slot);
423 void JSTestInterface::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)
425 JSTestInterface* thisObject = jsCast<JSTestInterface*>(cell);
426 ASSERT_GC_OBJECT_INHERITS(thisObject, info());
427 PropertyName propertyName = Identifier::from(exec, index);
428 PutPropertySlot slot(shouldThrow);
429 if (thisObject->putDelegate(exec, propertyName, value, slot))
431 Base::putByIndex(cell, exec, index, value, shouldThrow);
434 #if ENABLE(Condition22) || ENABLE(Condition23)
435 void setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* exec, JSObject*, JSValue value)
438 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
439 if (exec->hadException())
441 TestInterface::setImplementsStaticAttr(nativeValue);
446 #if ENABLE(Condition22) || ENABLE(Condition23)
447 void setJSTestInterfaceImplementsStr2(ExecState* exec, JSObject* thisObject, JSValue value)
450 JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
451 TestInterface& impl = castedThis->impl();
452 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
453 if (exec->hadException())
455 impl.setImplementsStr2(nativeValue);
460 #if ENABLE(Condition22) || ENABLE(Condition23)
461 void setJSTestInterfaceImplementsStr3(ExecState* exec, JSObject* thisObject, JSValue value)
464 jsCast<JSTestInterface*>(thisObject)->setImplementsStr3(exec, value);
469 #if ENABLE(Condition22) || ENABLE(Condition23)
470 void setJSTestInterfaceImplementsNode(ExecState* exec, JSObject* thisObject, JSValue value)
473 JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
474 TestInterface& impl = castedThis->impl();
475 Node* nativeValue(toNode(value));
476 if (exec->hadException())
478 impl.setImplementsNode(nativeValue);
483 #if ENABLE(Condition11) || ENABLE(Condition12)
484 void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject*, JSValue value)
487 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
488 if (exec->hadException())
490 TestSupplemental::setSupplementalStaticAttr(nativeValue);
495 #if ENABLE(Condition11) || ENABLE(Condition12)
496 void setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* thisObject, JSValue value)
499 JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
500 TestInterface& impl = castedThis->impl();
501 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
502 if (exec->hadException())
504 TestSupplemental::setSupplementalStr2(&impl, nativeValue);
509 #if ENABLE(Condition11) || ENABLE(Condition12)
510 void setJSTestInterfaceSupplementalStr3(ExecState* exec, JSObject* thisObject, JSValue value)
513 jsCast<JSTestInterface*>(thisObject)->setSupplementalStr3(exec, value);
518 #if ENABLE(Condition11) || ENABLE(Condition12)
519 void setJSTestInterfaceSupplementalNode(ExecState* exec, JSObject* thisObject, JSValue value)
522 JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
523 TestInterface& impl = castedThis->impl();
524 Node* nativeValue(toNode(value));
525 if (exec->hadException())
527 TestSupplemental::setSupplementalNode(&impl, nativeValue);
532 JSValue JSTestInterface::getConstructor(VM& vm, JSGlobalObject* globalObject)
534 return getDOMConstructor<JSTestInterfaceConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
537 #if ENABLE(Condition22) || ENABLE(Condition23)
538 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(ExecState* exec)
540 JSValue thisValue = exec->hostThisValue();
541 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
543 return throwVMTypeError(exec);
544 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
545 TestInterface& impl = castedThis->impl();
546 impl.implementsMethod1();
547 return JSValue::encode(jsUndefined());
552 #if ENABLE(Condition22) || ENABLE(Condition23)
553 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(ExecState* exec)
555 JSValue thisValue = exec->hostThisValue();
556 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
558 return throwVMTypeError(exec);
559 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
560 TestInterface& impl = castedThis->impl();
561 if (exec->argumentCount() < 2)
562 return throwVMError(exec, createNotEnoughArgumentsError(exec));
563 ExceptionCode ec = 0;
564 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
566 return JSValue::encode(jsUndefined());
567 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
568 if (exec->hadException())
569 return JSValue::encode(jsUndefined());
570 TestObj* objArg(toTestObj(exec->argument(1)));
571 if (exec->hadException())
572 return JSValue::encode(jsUndefined());
574 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(scriptContext, strArg, objArg, ec)));
575 setDOMException(exec, ec);
576 return JSValue::encode(result);
581 #if ENABLE(Condition22) || ENABLE(Condition23)
582 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(ExecState* exec)
584 JSValue thisValue = exec->hostThisValue();
585 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
587 return throwVMTypeError(exec);
588 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
589 return JSValue::encode(castedThis->implementsMethod3(exec));
594 #if ENABLE(Condition22) || ENABLE(Condition23)
595 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(ExecState* exec)
597 TestInterface::implementsMethod4();
598 return JSValue::encode(jsUndefined());
603 #if ENABLE(Condition11) || ENABLE(Condition12)
604 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(ExecState* exec)
606 JSValue thisValue = exec->hostThisValue();
607 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
609 return throwVMTypeError(exec);
610 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
611 TestInterface& impl = castedThis->impl();
612 TestSupplemental::supplementalMethod1(&impl);
613 return JSValue::encode(jsUndefined());
618 #if ENABLE(Condition11) || ENABLE(Condition12)
619 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* exec)
621 JSValue thisValue = exec->hostThisValue();
622 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
624 return throwVMTypeError(exec);
625 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
626 TestInterface& impl = castedThis->impl();
627 if (exec->argumentCount() < 2)
628 return throwVMError(exec, createNotEnoughArgumentsError(exec));
629 ExceptionCode ec = 0;
630 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
632 return JSValue::encode(jsUndefined());
633 const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
634 if (exec->hadException())
635 return JSValue::encode(jsUndefined());
636 TestObj* objArg(toTestObj(exec->argument(1)));
637 if (exec->hadException())
638 return JSValue::encode(jsUndefined());
640 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(&impl, scriptContext, strArg, objArg, ec)));
641 setDOMException(exec, ec);
642 return JSValue::encode(result);
647 #if ENABLE(Condition11) || ENABLE(Condition12)
648 EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(ExecState* exec)
650 JSValue thisValue = exec->hostThisValue();
651 JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(thisValue);
653 return throwVMTypeError(exec);
654 ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
655 return JSValue::encode(castedThis->supplementalMethod3(exec));
660 #if ENABLE(Condition11) || ENABLE(Condition12)
661 EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(ExecState* exec)
663 TestSupplemental::supplementalMethod4();
664 return JSValue::encode(jsUndefined());
671 #if ENABLE(Condition22) || ENABLE(Condition23)
672 EncodedJSValue jsTestInterfaceIMPLEMENTSCONSTANT1(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName)
675 return JSValue::encode(jsNumber(static_cast<int>(1)));
679 #if ENABLE(Condition22) || ENABLE(Condition23)
680 EncodedJSValue jsTestInterfaceIMPLEMENTSCONSTANT2(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName)
683 return JSValue::encode(jsNumber(static_cast<int>(2)));
687 #if ENABLE(Condition11) || ENABLE(Condition12)
688 EncodedJSValue jsTestInterfaceSUPPLEMENTALCONSTANT1(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName)
691 return JSValue::encode(jsNumber(static_cast<int>(1)));
695 #if ENABLE(Condition11) || ENABLE(Condition12)
696 EncodedJSValue jsTestInterfaceSUPPLEMENTALCONSTANT2(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName)
699 return JSValue::encode(jsNumber(static_cast<int>(2)));
703 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
705 JSTestInterface* jsTestInterface = jsCast<JSTestInterface*>(handle.get().asCell());
706 if (jsTestInterface->impl().hasPendingActivity())
708 UNUSED_PARAM(visitor);
712 void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
714 JSTestInterface* jsTestInterface = jsCast<JSTestInterface*>(handle.get().asCell());
715 DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
716 uncacheWrapper(world, &jsTestInterface->impl(), jsTestInterface);
717 jsTestInterface->releaseImpl();
720 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInterface* impl)
724 if (JSValue result = getExistingWrapper<JSTestInterface>(exec, impl))
727 // If you hit this failure the interface definition has the ImplementationLacksVTable
728 // attribute. You should remove that attribute. If the class has subclasses
729 // that may be passed through this toJS() function you should use the SkipVTableValidation
730 // attribute to TestInterface.
731 COMPILE_ASSERT(!__is_polymorphic(TestInterface), TestInterface_is_polymorphic_but_idl_claims_not_to_be);
733 ReportMemoryCost<TestInterface>::reportMemoryCost(exec, impl);
734 return createNewWrapper<JSTestInterface>(exec, globalObject, impl);
737 TestInterface* toTestInterface(JSC::JSValue value)
739 return value.inherits(JSTestInterface::info()) ? &jsCast<JSTestInterface*>(value)->impl() : 0;
744 #endif // ENABLE(Condition1) || ENABLE(Condition2)