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#include "JSTestObj.h" 23 24#include "ExceptionCode.h" 25#include "HTMLNames.h" 26#include "IDBBindingUtilities.h" 27#include "IDBKey.h" 28#include "JSDOMBinding.h" 29#include "JSEventListener.h" 30#include "JSOptionsObject.h" 31#include "JSTestCallback.h" 32#include "JSTestObj.h" 33#include "JSlog.h" 34#include "KURL.h" 35#include "ScriptArguments.h" 36#include "ScriptCallStack.h" 37#include "ScriptCallStackFactory.h" 38#include "SerializedScriptValue.h" 39#include "TestObj.h" 40#include <runtime/Error.h> 41#include <runtime/JSNumberCell.h> 42#include <runtime/JSString.h> 43#include <wtf/GetPtr.h> 44 45using namespace JSC; 46 47namespace WebCore { 48 49ASSERT_CLASS_FITS_IN_CELL(JSTestObj); 50 51/* Hash table */ 52#if ENABLE(JIT) 53#define THUNK_GENERATOR(generator) , generator 54#else 55#define THUNK_GENERATOR(generator) 56#endif 57 58static const HashTableValue JSTestObjTableValues[37] = 59{ 60 { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) }, 61 { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) }, 62 { "readOnlyTestObjAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0 THUNK_GENERATOR(0) }, 63 { "shortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjShortAttr), (intptr_t)setJSTestObjShortAttr THUNK_GENERATOR(0) }, 64 { "unsignedShortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedShortAttr), (intptr_t)setJSTestObjUnsignedShortAttr THUNK_GENERATOR(0) }, 65 { "intAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjIntAttr), (intptr_t)setJSTestObjIntAttr THUNK_GENERATOR(0) }, 66 { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr THUNK_GENERATOR(0) }, 67 { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) }, 68 { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) }, 69 { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) }, 70 { "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr THUNK_GENERATOR(0) }, 71 { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) }, 72 { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) }, 73 { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) }, 74 { "reflectedUnsignedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedUnsignedIntegralAttr), (intptr_t)setJSTestObjReflectedUnsignedIntegralAttr THUNK_GENERATOR(0) }, 75 { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) }, 76 { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) }, 77 { "reflectedNonEmptyURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedNonEmptyURLAttr), (intptr_t)setJSTestObjReflectedNonEmptyURLAttr THUNK_GENERATOR(0) }, 78 { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) }, 79 { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr THUNK_GENERATOR(0) }, 80 { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr THUNK_GENERATOR(0) }, 81 { "reflectedCustomURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t)setJSTestObjReflectedCustomURLAttr THUNK_GENERATOR(0) }, 82 { "reflectedCustomNonEmptyURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomNonEmptyURLAttr), (intptr_t)setJSTestObjReflectedCustomNonEmptyURLAttr THUNK_GENERATOR(0) }, 83 { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) }, 84 { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) }, 85 { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException THUNK_GENERATOR(0) }, 86 { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException THUNK_GENERATOR(0) }, 87 { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) }, 88 { "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) }, 89#if ENABLE(Condition1) 90 { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1 THUNK_GENERATOR(0) }, 91#endif 92#if ENABLE(Condition1) && ENABLE(Condition2) 93 { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2 THUNK_GENERATOR(0) }, 94#endif 95#if ENABLE(Condition1) || ENABLE(Condition2) 96 { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3 THUNK_GENERATOR(0) }, 97#endif 98 { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0 THUNK_GENERATOR(0) }, 99 { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId THUNK_GENERATOR(0) }, 100 { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0 THUNK_GENERATOR(0) }, 101 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, 102 { 0, 0, 0, 0 THUNK_GENERATOR(0) } 103}; 104 105#undef THUNK_GENERATOR 106static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 133, 127, JSTestObjTableValues, 0 }; 107/* Hash table for constructor */ 108#if ENABLE(JIT) 109#define THUNK_GENERATOR(generator) , generator 110#else 111#define THUNK_GENERATOR(generator) 112#endif 113 114static const HashTableValue JSTestObjConstructorTableValues[12] = 115{ 116 { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) }, 117 { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) }, 118 { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) }, 119 { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) }, 120 { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) }, 121 { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) }, 122 { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) }, 123 { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) }, 124 { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) }, 125 { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) }, 126 { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) }, 127 { 0, 0, 0, 0 THUNK_GENERATOR(0) } 128}; 129 130#undef THUNK_GENERATOR 131static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 33, 31, JSTestObjConstructorTableValues, 0 }; 132 133COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDontCheckEnums); 134COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDontCheckEnums); 135COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDontCheckEnums); 136COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDontCheckEnums); 137COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDontCheckEnums); 138COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDontCheckEnums); 139COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDontCheckEnums); 140COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDontCheckEnums); 141COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDontCheckEnums); 142COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDontCheckEnums); 143COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDontCheckEnums); 144 145class JSTestObjConstructor : public DOMConstructorObject { 146public: 147 JSTestObjConstructor(JSC::ExecState*, JSDOMGlobalObject*); 148 149 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 150 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 151 static const JSC::ClassInfo s_info; 152 static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) 153 { 154 return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 155 } 156protected: 157 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; 158}; 159 160const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", &DOMConstructorObject::s_info, &JSTestObjConstructorTable, 0 }; 161 162JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) 163 : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject) 164{ 165 ASSERT(inherits(&s_info)); 166 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly); 167} 168 169bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 170{ 171 return getStaticValueSlot<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, slot); 172} 173 174bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 175{ 176 return getStaticValueDescriptor<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, descriptor); 177} 178 179/* Hash table for prototype */ 180#if ENABLE(JIT) 181#define THUNK_GENERATOR(generator) , generator 182#else 183#define THUNK_GENERATOR(generator) 184#endif 185 186static const HashTableValue JSTestObjPrototypeTableValues[48] = 187{ 188 { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) }, 189 { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) }, 190 { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0 THUNK_GENERATOR(0) }, 191 { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0 THUNK_GENERATOR(0) }, 192 { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0 THUNK_GENERATOR(0) }, 193 { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0 THUNK_GENERATOR(0) }, 194 { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0 THUNK_GENERATOR(0) }, 195 { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0 THUNK_GENERATOR(0) }, 196 { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0 THUNK_GENERATOR(0) }, 197 { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0 THUNK_GENERATOR(0) }, 198 { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0 THUNK_GENERATOR(0) }, 199 { "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) }, 200 { "voidMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) }, 201 { "intMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethod), (intptr_t)0 THUNK_GENERATOR(0) }, 202 { "intMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIntMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) }, 203 { "objMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t)0 THUNK_GENERATOR(0) }, 204 { "objMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) }, 205 { "methodThatRequiresAllArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgs), (intptr_t)2 THUNK_GENERATOR(0) }, 206 { "methodThatRequiresAllArgsAndThrows", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t)2 THUNK_GENERATOR(0) }, 207 { "serializedValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1 THUNK_GENERATOR(0) }, 208 { "idbKey", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIdbKey), (intptr_t)1 THUNK_GENERATOR(0) }, 209 { "optionsObject", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t)2 THUNK_GENERATOR(0) }, 210 { "methodWithException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0 THUNK_GENERATOR(0) }, 211 { "customMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0 THUNK_GENERATOR(0) }, 212 { "customMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) }, 213 { "customArgsAndException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1 THUNK_GENERATOR(0) }, 214 { "addEventListener", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3 THUNK_GENERATOR(0) }, 215 { "removeEventListener", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3 THUNK_GENERATOR(0) }, 216 { "withDynamicFrame", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrame), (intptr_t)0 THUNK_GENERATOR(0) }, 217 { "withDynamicFrameAndArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndArg), (intptr_t)1 THUNK_GENERATOR(0) }, 218 { "withDynamicFrameAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) }, 219 { "withDynamicFrameAndUserGesture", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture), (intptr_t)1 THUNK_GENERATOR(0) }, 220 { "withDynamicFrameAndUserGestureASAD", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD), (intptr_t)2 THUNK_GENERATOR(0) }, 221 { "withScriptStateVoid", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0 THUNK_GENERATOR(0) }, 222 { "withScriptStateObj", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0 THUNK_GENERATOR(0) }, 223 { "withScriptStateVoidException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0 THUNK_GENERATOR(0) }, 224 { "withScriptStateObjException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0 THUNK_GENERATOR(0) }, 225 { "withScriptExecutionContext", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t)0 THUNK_GENERATOR(0) }, 226 { "methodWithOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) }, 227 { "methodWithNonOptionalArgAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) }, 228 { "methodWithNonOptionalArgAndTwoOptionalArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t)3 THUNK_GENERATOR(0) }, 229 { "methodWithCallbackArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t)1 THUNK_GENERATOR(0) }, 230 { "methodWithNonCallbackArgAndCallbackArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t)2 THUNK_GENERATOR(0) }, 231 { "methodWithCallbackAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) }, 232 { "overloadedMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2 THUNK_GENERATOR(0) }, 233 { "classMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethod), (intptr_t)0 THUNK_GENERATOR(0) }, 234 { "classMethodWithOptional", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethodWithOptional), (intptr_t)1 THUNK_GENERATOR(0) }, 235 { 0, 0, 0, 0 THUNK_GENERATOR(0) } 236}; 237 238#undef THUNK_GENERATOR 239static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 136, 127, JSTestObjPrototypeTableValues, 0 }; 240const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestObjPrototypeTable, 0 }; 241 242JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject) 243{ 244 return getDOMPrototype<JSTestObj>(exec, globalObject); 245} 246 247bool JSTestObjPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 248{ 249 return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, slot); 250} 251 252bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 253{ 254 return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor); 255} 256 257const ClassInfo JSTestObj::s_info = { "TestObj", &DOMObjectWithGlobalPointer::s_info, &JSTestObjTable, 0 }; 258 259JSTestObj::JSTestObj(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl) 260 : DOMObjectWithGlobalPointer(structure, globalObject) 261 , m_impl(impl) 262{ 263 ASSERT(inherits(&s_info)); 264} 265 266JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject) 267{ 268 return new (exec) JSTestObjPrototype(globalObject, JSTestObjPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); 269} 270 271bool JSTestObj::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 272{ 273 return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, slot); 274} 275 276bool JSTestObj::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 277{ 278 return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, descriptor); 279} 280 281JSValue jsTestObjReadOnlyIntAttr(ExecState* exec, JSValue slotBase, const Identifier&) 282{ 283 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 284 UNUSED_PARAM(exec); 285 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 286 JSValue result = jsNumber(imp->readOnlyIntAttr()); 287 return result; 288} 289 290JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) 291{ 292 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 293 UNUSED_PARAM(exec); 294 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 295 JSValue result = jsString(exec, imp->readOnlyStringAttr()); 296 return result; 297} 298 299JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&) 300{ 301 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 302 UNUSED_PARAM(exec); 303 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 304 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->readOnlyTestObjAttr())); 305 return result; 306} 307 308JSValue jsTestObjShortAttr(ExecState* exec, JSValue slotBase, const Identifier&) 309{ 310 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 311 UNUSED_PARAM(exec); 312 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 313 JSValue result = jsNumber(imp->shortAttr()); 314 return result; 315} 316 317JSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSValue slotBase, const Identifier&) 318{ 319 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 320 UNUSED_PARAM(exec); 321 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 322 JSValue result = jsNumber(imp->unsignedShortAttr()); 323 return result; 324} 325 326JSValue jsTestObjIntAttr(ExecState* exec, JSValue slotBase, const Identifier&) 327{ 328 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 329 UNUSED_PARAM(exec); 330 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 331 JSValue result = jsNumber(imp->intAttr()); 332 return result; 333} 334 335JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&) 336{ 337 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 338 UNUSED_PARAM(exec); 339 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 340 JSValue result = jsNumber(imp->longLongAttr()); 341 return result; 342} 343 344JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&) 345{ 346 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 347 UNUSED_PARAM(exec); 348 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 349 JSValue result = jsNumber(imp->unsignedLongLongAttr()); 350 return result; 351} 352 353JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) 354{ 355 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 356 UNUSED_PARAM(exec); 357 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 358 JSValue result = jsString(exec, imp->stringAttr()); 359 return result; 360} 361 362JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier&) 363{ 364 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 365 UNUSED_PARAM(exec); 366 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 367 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->testObjAttr())); 368 return result; 369} 370 371JSValue jsTestObjXMLObjAttr(ExecState* exec, JSValue slotBase, const Identifier&) 372{ 373 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 374 UNUSED_PARAM(exec); 375 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 376 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->xmlObjAttr())); 377 return result; 378} 379 380JSValue jsTestObjCreate(ExecState* exec, JSValue slotBase, const Identifier&) 381{ 382 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 383 UNUSED_PARAM(exec); 384 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 385 JSValue result = jsBoolean(imp->isCreate()); 386 return result; 387} 388 389JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) 390{ 391 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 392 UNUSED_PARAM(exec); 393 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 394 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); 395 return result; 396} 397 398JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&) 399{ 400 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 401 UNUSED_PARAM(exec); 402 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 403 JSValue result = jsNumber(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); 404 return result; 405} 406 407JSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&) 408{ 409 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 410 UNUSED_PARAM(exec); 411 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 412 JSValue result = jsNumber(std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr))); 413 return result; 414} 415 416JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&) 417{ 418 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 419 UNUSED_PARAM(exec); 420 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 421 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); 422 return result; 423} 424 425JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&) 426{ 427 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 428 UNUSED_PARAM(exec); 429 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 430 JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); 431 return result; 432} 433 434JSValue jsTestObjReflectedNonEmptyURLAttr(ExecState* exec, JSValue slotBase, const Identifier&) 435{ 436 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 437 UNUSED_PARAM(exec); 438 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 439 JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr)); 440 return result; 441} 442 443JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) 444{ 445 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 446 UNUSED_PARAM(exec); 447 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 448 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); 449 return result; 450} 451 452JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&) 453{ 454 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 455 UNUSED_PARAM(exec); 456 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 457 JSValue result = jsNumber(imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); 458 return result; 459} 460 461JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&) 462{ 463 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 464 UNUSED_PARAM(exec); 465 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 466 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); 467 return result; 468} 469 470JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, const Identifier&) 471{ 472 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 473 UNUSED_PARAM(exec); 474 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 475 JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); 476 return result; 477} 478 479JSValue jsTestObjReflectedCustomNonEmptyURLAttr(ExecState* exec, JSValue slotBase, const Identifier&) 480{ 481 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 482 UNUSED_PARAM(exec); 483 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 484 JSValue result = jsString(exec, imp->getNonEmptyURLAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr)); 485 return result; 486} 487 488JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&) 489{ 490 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 491 ExceptionCode ec = 0; 492 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 493 JSC::JSValue result = jsNumber(imp->attrWithGetterException(ec)); 494 setDOMException(exec, ec); 495 return result; 496} 497 498JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&) 499{ 500 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 501 UNUSED_PARAM(exec); 502 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 503 JSValue result = jsNumber(imp->attrWithSetterException()); 504 return result; 505} 506 507JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&) 508{ 509 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 510 ExceptionCode ec = 0; 511 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 512 JSC::JSValue result = jsString(exec, imp->stringAttrWithGetterException(ec)); 513 setDOMException(exec, ec); 514 return result; 515} 516 517JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&) 518{ 519 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 520 UNUSED_PARAM(exec); 521 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 522 JSValue result = jsString(exec, imp->stringAttrWithSetterException()); 523 return result; 524} 525 526JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier&) 527{ 528 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 529 return castedThis->customAttr(exec); 530} 531 532JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&) 533{ 534 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 535 UNUSED_PARAM(exec); 536 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 537 JSValue result = jsOwnedStringOrNull(exec, imp->scriptStringAttr()); 538 return result; 539} 540 541#if ENABLE(Condition1) 542JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&) 543{ 544 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 545 UNUSED_PARAM(exec); 546 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 547 JSValue result = jsNumber(imp->conditionalAttr1()); 548 return result; 549} 550#endif 551 552#if ENABLE(Condition1) && ENABLE(Condition2) 553JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&) 554{ 555 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 556 UNUSED_PARAM(exec); 557 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 558 JSValue result = jsNumber(imp->conditionalAttr2()); 559 return result; 560} 561#endif 562 563#if ENABLE(Condition1) || ENABLE(Condition2) 564JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&) 565{ 566 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 567 UNUSED_PARAM(exec); 568 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 569 JSValue result = jsNumber(imp->conditionalAttr3()); 570 return result; 571} 572#endif 573 574JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&) 575{ 576 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 577 UNUSED_PARAM(exec); 578 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 579 JSValue result = jsNumber(imp->description()); 580 return result; 581} 582 583JSValue jsTestObjId(ExecState* exec, JSValue slotBase, const Identifier&) 584{ 585 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 586 UNUSED_PARAM(exec); 587 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 588 JSValue result = jsNumber(imp->id()); 589 return result; 590} 591 592JSValue jsTestObjHash(ExecState* exec, JSValue slotBase, const Identifier&) 593{ 594 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase)); 595 UNUSED_PARAM(exec); 596 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 597 JSValue result = jsString(exec, imp->hash()); 598 return result; 599} 600 601JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier&) 602{ 603 JSTestObj* domObject = static_cast<JSTestObj*>(asObject(slotBase)); 604 return JSTestObj::getConstructor(exec, domObject->globalObject()); 605} 606 607void JSTestObj::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) 608{ 609 lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, this, slot); 610} 611 612void setJSTestObjShortAttr(ExecState* exec, JSObject* thisObject, JSValue value) 613{ 614 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 615 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 616 imp->setShortAttr(value.toInt32(exec)); 617} 618 619void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* thisObject, JSValue value) 620{ 621 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 622 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 623 imp->setUnsignedShortAttr(value.toUInt32(exec)); 624} 625 626void setJSTestObjIntAttr(ExecState* exec, JSObject* thisObject, JSValue value) 627{ 628 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 629 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 630 imp->setIntAttr(value.toInt32(exec)); 631} 632 633void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) 634{ 635 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 636 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 637 imp->setLongLongAttr(static_cast<long long>(value.toInteger(exec))); 638} 639 640void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) 641{ 642 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 643 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 644 imp->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec))); 645} 646 647void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) 648{ 649 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 650 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 651 imp->setStringAttr(ustringToString(value.toString(exec))); 652} 653 654void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value) 655{ 656 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 657 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 658 imp->setTestObjAttr(toTestObj(value)); 659} 660 661void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* thisObject, JSValue value) 662{ 663 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 664 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 665 imp->setXMLObjAttr(toTestObj(value)); 666} 667 668void setJSTestObjCreate(ExecState* exec, JSObject* thisObject, JSValue value) 669{ 670 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 671 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 672 imp->setCreate(value.toBoolean(exec)); 673} 674 675void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) 676{ 677 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 678 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 679 imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value)); 680} 681 682void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) 683{ 684 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 685 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 686 imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec)); 687} 688 689void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) 690{ 691 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 692 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 693 imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, value.toUInt32(exec)); 694} 695 696void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value) 697{ 698 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 699 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 700 imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec)); 701} 702 703void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) 704{ 705 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 706 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 707 imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value)); 708} 709 710void setJSTestObjReflectedNonEmptyURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) 711{ 712 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 713 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 714 imp->setAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr, valueToStringWithNullCheck(exec, value)); 715} 716 717void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) 718{ 719 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 720 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 721 imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value)); 722} 723 724void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) 725{ 726 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 727 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 728 imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec)); 729} 730 731void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value) 732{ 733 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 734 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 735 imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec)); 736} 737 738void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) 739{ 740 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 741 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 742 imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value)); 743} 744 745void setJSTestObjReflectedCustomNonEmptyURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) 746{ 747 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 748 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 749 imp->setAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr, valueToStringWithNullCheck(exec, value)); 750} 751 752void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) 753{ 754 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 755 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 756 ExceptionCode ec = 0; 757 imp->setAttrWithGetterException(value.toInt32(exec), ec); 758 setDOMException(exec, ec); 759} 760 761void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value) 762{ 763 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 764 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 765 ExceptionCode ec = 0; 766 imp->setAttrWithSetterException(value.toInt32(exec), ec); 767 setDOMException(exec, ec); 768} 769 770void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) 771{ 772 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 773 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 774 ExceptionCode ec = 0; 775 imp->setStringAttrWithGetterException(ustringToString(value.toString(exec)), ec); 776 setDOMException(exec, ec); 777} 778 779void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value) 780{ 781 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 782 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 783 ExceptionCode ec = 0; 784 imp->setStringAttrWithSetterException(ustringToString(value.toString(exec)), ec); 785 setDOMException(exec, ec); 786} 787 788void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value) 789{ 790 static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value); 791} 792 793#if ENABLE(Condition1) 794void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value) 795{ 796 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 797 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 798 imp->setConditionalAttr1(value.toInt32(exec)); 799} 800#endif 801 802#if ENABLE(Condition1) && ENABLE(Condition2) 803void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value) 804{ 805 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 806 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 807 imp->setConditionalAttr2(value.toInt32(exec)); 808} 809#endif 810 811#if ENABLE(Condition1) || ENABLE(Condition2) 812void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value) 813{ 814 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 815 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 816 imp->setConditionalAttr3(value.toInt32(exec)); 817} 818#endif 819 820void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value) 821{ 822 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 823 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 824 imp->setId(value.toInt32(exec)); 825} 826 827JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject) 828{ 829 return getDOMConstructor<JSTestObjConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); 830} 831 832EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec) 833{ 834 JSValue thisValue = exec->hostThisValue(); 835 if (!thisValue.inherits(&JSTestObj::s_info)) 836 return throwVMTypeError(exec); 837 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 838 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 839 840 imp->voidMethod(); 841 return JSValue::encode(jsUndefined()); 842} 843 844EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec) 845{ 846 JSValue thisValue = exec->hostThisValue(); 847 if (!thisValue.inherits(&JSTestObj::s_info)) 848 return throwVMTypeError(exec); 849 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 850 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 851 int intArg(exec->argument(0).toInt32(exec)); 852 if (exec->hadException()) 853 return JSValue::encode(jsUndefined()); 854 const String& strArg(ustringToString(exec->argument(1).toString(exec))); 855 if (exec->hadException()) 856 return JSValue::encode(jsUndefined()); 857 TestObj* objArg(toTestObj(exec->argument(2))); 858 if (exec->hadException()) 859 return JSValue::encode(jsUndefined()); 860 861 imp->voidMethodWithArgs(intArg, strArg, objArg); 862 return JSValue::encode(jsUndefined()); 863} 864 865EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec) 866{ 867 JSValue thisValue = exec->hostThisValue(); 868 if (!thisValue.inherits(&JSTestObj::s_info)) 869 return throwVMTypeError(exec); 870 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 871 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 872 873 874 JSC::JSValue result = jsNumber(imp->intMethod()); 875 return JSValue::encode(result); 876} 877 878EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecState* exec) 879{ 880 JSValue thisValue = exec->hostThisValue(); 881 if (!thisValue.inherits(&JSTestObj::s_info)) 882 return throwVMTypeError(exec); 883 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 884 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 885 int intArg(exec->argument(0).toInt32(exec)); 886 if (exec->hadException()) 887 return JSValue::encode(jsUndefined()); 888 const String& strArg(ustringToString(exec->argument(1).toString(exec))); 889 if (exec->hadException()) 890 return JSValue::encode(jsUndefined()); 891 TestObj* objArg(toTestObj(exec->argument(2))); 892 if (exec->hadException()) 893 return JSValue::encode(jsUndefined()); 894 895 896 JSC::JSValue result = jsNumber(imp->intMethodWithArgs(intArg, strArg, objArg)); 897 return JSValue::encode(result); 898} 899 900EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec) 901{ 902 JSValue thisValue = exec->hostThisValue(); 903 if (!thisValue.inherits(&JSTestObj::s_info)) 904 return throwVMTypeError(exec); 905 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 906 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 907 908 909 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethod())); 910 return JSValue::encode(result); 911} 912 913EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec) 914{ 915 JSValue thisValue = exec->hostThisValue(); 916 if (!thisValue.inherits(&JSTestObj::s_info)) 917 return throwVMTypeError(exec); 918 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 919 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 920 int intArg(exec->argument(0).toInt32(exec)); 921 if (exec->hadException()) 922 return JSValue::encode(jsUndefined()); 923 const String& strArg(ustringToString(exec->argument(1).toString(exec))); 924 if (exec->hadException()) 925 return JSValue::encode(jsUndefined()); 926 TestObj* objArg(toTestObj(exec->argument(2))); 927 if (exec->hadException()) 928 return JSValue::encode(jsUndefined()); 929 930 931 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethodWithArgs(intArg, strArg, objArg))); 932 return JSValue::encode(result); 933} 934 935EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgs(ExecState* exec) 936{ 937 JSValue thisValue = exec->hostThisValue(); 938 if (!thisValue.inherits(&JSTestObj::s_info)) 939 return throwVMTypeError(exec); 940 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 941 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 942 if (exec->argumentCount() < 2) 943 return JSValue::encode(jsUndefined()); 944 const String& strArg(ustringToString(exec->argument(0).toString(exec))); 945 if (exec->hadException()) 946 return JSValue::encode(jsUndefined()); 947 TestObj* objArg(toTestObj(exec->argument(1))); 948 if (exec->hadException()) 949 return JSValue::encode(jsUndefined()); 950 951 952 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgs(strArg, objArg))); 953 return JSValue::encode(result); 954} 955 956EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec) 957{ 958 JSValue thisValue = exec->hostThisValue(); 959 if (!thisValue.inherits(&JSTestObj::s_info)) 960 return throwVMTypeError(exec); 961 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 962 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 963 if (exec->argumentCount() < 2) 964 return throwVMError(exec, createSyntaxError(exec, "Not enough arguments")); 965 ExceptionCode ec = 0; 966 const String& strArg(ustringToString(exec->argument(0).toString(exec))); 967 if (exec->hadException()) 968 return JSValue::encode(jsUndefined()); 969 TestObj* objArg(toTestObj(exec->argument(1))); 970 if (exec->hadException()) 971 return JSValue::encode(jsUndefined()); 972 973 974 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec))); 975 setDOMException(exec, ec); 976 return JSValue::encode(result); 977} 978 979EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec) 980{ 981 JSValue thisValue = exec->hostThisValue(); 982 if (!thisValue.inherits(&JSTestObj::s_info)) 983 return throwVMTypeError(exec); 984 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 985 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 986 RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0))); 987 if (exec->hadException()) 988 return JSValue::encode(jsUndefined()); 989 990 imp->serializedValue(serializedArg); 991 return JSValue::encode(jsUndefined()); 992} 993 994EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec) 995{ 996 JSValue thisValue = exec->hostThisValue(); 997 if (!thisValue.inherits(&JSTestObj::s_info)) 998 return throwVMTypeError(exec); 999 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1000 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1001 RefPtr<IDBKey> key(createIDBKeyFromValue(exec, exec->argument(0))); 1002 if (exec->hadException()) 1003 return JSValue::encode(jsUndefined()); 1004 1005 imp->idbKey(key); 1006 return JSValue::encode(jsUndefined()); 1007} 1008 1009EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec) 1010{ 1011 JSValue thisValue = exec->hostThisValue(); 1012 if (!thisValue.inherits(&JSTestObj::s_info)) 1013 return throwVMTypeError(exec); 1014 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1015 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1016 OptionsObject* oo(toOptionsObject(exec->argument(0))); 1017 if (exec->hadException()) 1018 return JSValue::encode(jsUndefined()); 1019 1020 int argsCount = exec->argumentCount(); 1021 if (argsCount <= 1) { 1022 imp->optionsObject(oo); 1023 return JSValue::encode(jsUndefined()); 1024 } 1025 1026 OptionsObject* ooo(toOptionsObject(exec->argument(1))); 1027 if (exec->hadException()) 1028 return JSValue::encode(jsUndefined()); 1029 1030 imp->optionsObject(oo, ooo); 1031 return JSValue::encode(jsUndefined()); 1032} 1033 1034EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec) 1035{ 1036 JSValue thisValue = exec->hostThisValue(); 1037 if (!thisValue.inherits(&JSTestObj::s_info)) 1038 return throwVMTypeError(exec); 1039 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1040 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1041 ExceptionCode ec = 0; 1042 1043 imp->methodWithException(ec); 1044 setDOMException(exec, ec); 1045 return JSValue::encode(jsUndefined()); 1046} 1047 1048EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec) 1049{ 1050 JSValue thisValue = exec->hostThisValue(); 1051 if (!thisValue.inherits(&JSTestObj::s_info)) 1052 return throwVMTypeError(exec); 1053 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1054 return JSValue::encode(castedThis->customMethod(exec)); 1055} 1056 1057EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec) 1058{ 1059 JSValue thisValue = exec->hostThisValue(); 1060 if (!thisValue.inherits(&JSTestObj::s_info)) 1061 return throwVMTypeError(exec); 1062 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1063 return JSValue::encode(castedThis->customMethodWithArgs(exec)); 1064} 1065 1066EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(ExecState* exec) 1067{ 1068 JSValue thisValue = exec->hostThisValue(); 1069 if (!thisValue.inherits(&JSTestObj::s_info)) 1070 return throwVMTypeError(exec); 1071 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1072 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1073 ExceptionCode ec = 0; 1074 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 1)); 1075 size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1; 1076 RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize)); 1077 log* intArg(tolog(exec->argument(0))); 1078 if (exec->hadException()) 1079 return JSValue::encode(jsUndefined()); 1080 1081 imp->customArgsAndException(intArg, scriptArguments, callStack, ec); 1082 setDOMException(exec, ec); 1083 return JSValue::encode(jsUndefined()); 1084} 1085 1086EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec) 1087{ 1088 JSValue thisValue = exec->hostThisValue(); 1089 if (!thisValue.inherits(&JSTestObj::s_info)) 1090 return throwVMTypeError(exec); 1091 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1092 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1093 JSValue listener = exec->argument(1); 1094 if (!listener.isObject()) 1095 return JSValue::encode(jsUndefined()); 1096 imp->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec)); 1097 return JSValue::encode(jsUndefined()); 1098} 1099 1100EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec) 1101{ 1102 JSValue thisValue = exec->hostThisValue(); 1103 if (!thisValue.inherits(&JSTestObj::s_info)) 1104 return throwVMTypeError(exec); 1105 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1106 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1107 JSValue listener = exec->argument(1); 1108 if (!listener.isObject()) 1109 return JSValue::encode(jsUndefined()); 1110 imp->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec)); 1111 return JSValue::encode(jsUndefined()); 1112} 1113 1114EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(ExecState* exec) 1115{ 1116 JSValue thisValue = exec->hostThisValue(); 1117 if (!thisValue.inherits(&JSTestObj::s_info)) 1118 return throwVMTypeError(exec); 1119 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1120 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1121 Frame* dynamicFrame = toDynamicFrame(exec); 1122 if (!dynamicFrame) 1123 return JSValue::encode(jsUndefined()); 1124 1125 imp->withDynamicFrame(dynamicFrame); 1126 return JSValue::encode(jsUndefined()); 1127} 1128 1129EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(ExecState* exec) 1130{ 1131 JSValue thisValue = exec->hostThisValue(); 1132 if (!thisValue.inherits(&JSTestObj::s_info)) 1133 return throwVMTypeError(exec); 1134 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1135 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1136 Frame* dynamicFrame = toDynamicFrame(exec); 1137 if (!dynamicFrame) 1138 return JSValue::encode(jsUndefined()); 1139 int intArg(exec->argument(0).toInt32(exec)); 1140 if (exec->hadException()) 1141 return JSValue::encode(jsUndefined()); 1142 1143 imp->withDynamicFrameAndArg(dynamicFrame, intArg); 1144 return JSValue::encode(jsUndefined()); 1145} 1146 1147EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(ExecState* exec) 1148{ 1149 JSValue thisValue = exec->hostThisValue(); 1150 if (!thisValue.inherits(&JSTestObj::s_info)) 1151 return throwVMTypeError(exec); 1152 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1153 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1154 Frame* dynamicFrame = toDynamicFrame(exec); 1155 if (!dynamicFrame) 1156 return JSValue::encode(jsUndefined()); 1157 int intArg(exec->argument(0).toInt32(exec)); 1158 if (exec->hadException()) 1159 return JSValue::encode(jsUndefined()); 1160 1161 int argsCount = exec->argumentCount(); 1162 if (argsCount <= 1) { 1163 imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg); 1164 return JSValue::encode(jsUndefined()); 1165 } 1166 1167 int optionalArg(exec->argument(1).toInt32(exec)); 1168 if (exec->hadException()) 1169 return JSValue::encode(jsUndefined()); 1170 1171 imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg, optionalArg); 1172 return JSValue::encode(jsUndefined()); 1173} 1174 1175EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(ExecState* exec) 1176{ 1177 JSValue thisValue = exec->hostThisValue(); 1178 if (!thisValue.inherits(&JSTestObj::s_info)) 1179 return throwVMTypeError(exec); 1180 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1181 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1182 Frame* dynamicFrame = toDynamicFrame(exec); 1183 if (!dynamicFrame) 1184 return JSValue::encode(jsUndefined()); 1185 int intArg(exec->argument(0).toInt32(exec)); 1186 if (exec->hadException()) 1187 return JSValue::encode(jsUndefined()); 1188 1189 imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, processingUserGesture()); 1190 return JSValue::encode(jsUndefined()); 1191} 1192 1193EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(ExecState* exec) 1194{ 1195 JSValue thisValue = exec->hostThisValue(); 1196 if (!thisValue.inherits(&JSTestObj::s_info)) 1197 return throwVMTypeError(exec); 1198 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1199 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1200 Frame* dynamicFrame = toDynamicFrame(exec); 1201 if (!dynamicFrame) 1202 return JSValue::encode(jsUndefined()); 1203 int intArg(exec->argument(0).toInt32(exec)); 1204 if (exec->hadException()) 1205 return JSValue::encode(jsUndefined()); 1206 1207 int argsCount = exec->argumentCount(); 1208 if (argsCount <= 1) { 1209 imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg); 1210 return JSValue::encode(jsUndefined()); 1211 } 1212 1213 int optionalArg(exec->argument(1).toInt32(exec)); 1214 if (exec->hadException()) 1215 return JSValue::encode(jsUndefined()); 1216 1217 imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, processingUserGesture()); 1218 return JSValue::encode(jsUndefined()); 1219} 1220 1221EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec) 1222{ 1223 JSValue thisValue = exec->hostThisValue(); 1224 if (!thisValue.inherits(&JSTestObj::s_info)) 1225 return throwVMTypeError(exec); 1226 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1227 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1228 1229 imp->withScriptStateVoid(exec); 1230 return JSValue::encode(jsUndefined()); 1231} 1232 1233EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec) 1234{ 1235 JSValue thisValue = exec->hostThisValue(); 1236 if (!thisValue.inherits(&JSTestObj::s_info)) 1237 return throwVMTypeError(exec); 1238 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1239 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1240 1241 1242 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObj(exec))); 1243 if (exec->hadException()) 1244 return JSValue::encode(jsUndefined()); 1245 return JSValue::encode(result); 1246} 1247 1248EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec) 1249{ 1250 JSValue thisValue = exec->hostThisValue(); 1251 if (!thisValue.inherits(&JSTestObj::s_info)) 1252 return throwVMTypeError(exec); 1253 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1254 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1255 ExceptionCode ec = 0; 1256 1257 imp->withScriptStateVoidException(exec, ec); 1258 setDOMException(exec, ec); 1259 return JSValue::encode(jsUndefined()); 1260} 1261 1262EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec) 1263{ 1264 JSValue thisValue = exec->hostThisValue(); 1265 if (!thisValue.inherits(&JSTestObj::s_info)) 1266 return throwVMTypeError(exec); 1267 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1268 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1269 ExceptionCode ec = 0; 1270 1271 1272 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->withScriptStateObjException(exec, ec))); 1273 setDOMException(exec, ec); 1274 if (exec->hadException()) 1275 return JSValue::encode(jsUndefined()); 1276 return JSValue::encode(result); 1277} 1278 1279EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec) 1280{ 1281 JSValue thisValue = exec->hostThisValue(); 1282 if (!thisValue.inherits(&JSTestObj::s_info)) 1283 return throwVMTypeError(exec); 1284 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1285 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1286 ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); 1287 if (!scriptContext) 1288 return JSValue::encode(jsUndefined()); 1289 1290 imp->withScriptExecutionContext(scriptContext); 1291 return JSValue::encode(jsUndefined()); 1292} 1293 1294EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec) 1295{ 1296 JSValue thisValue = exec->hostThisValue(); 1297 if (!thisValue.inherits(&JSTestObj::s_info)) 1298 return throwVMTypeError(exec); 1299 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1300 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1301 1302 int argsCount = exec->argumentCount(); 1303 if (argsCount <= 0) { 1304 imp->methodWithOptionalArg(); 1305 return JSValue::encode(jsUndefined()); 1306 } 1307 1308 int opt(exec->argument(0).toInt32(exec)); 1309 if (exec->hadException()) 1310 return JSValue::encode(jsUndefined()); 1311 1312 imp->methodWithOptionalArg(opt); 1313 return JSValue::encode(jsUndefined()); 1314} 1315 1316EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec) 1317{ 1318 JSValue thisValue = exec->hostThisValue(); 1319 if (!thisValue.inherits(&JSTestObj::s_info)) 1320 return throwVMTypeError(exec); 1321 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1322 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1323 int nonOpt(exec->argument(0).toInt32(exec)); 1324 if (exec->hadException()) 1325 return JSValue::encode(jsUndefined()); 1326 1327 int argsCount = exec->argumentCount(); 1328 if (argsCount <= 1) { 1329 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); 1330 return JSValue::encode(jsUndefined()); 1331 } 1332 1333 int opt(exec->argument(1).toInt32(exec)); 1334 if (exec->hadException()) 1335 return JSValue::encode(jsUndefined()); 1336 1337 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); 1338 return JSValue::encode(jsUndefined()); 1339} 1340 1341EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec) 1342{ 1343 JSValue thisValue = exec->hostThisValue(); 1344 if (!thisValue.inherits(&JSTestObj::s_info)) 1345 return throwVMTypeError(exec); 1346 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1347 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1348 int nonOpt(exec->argument(0).toInt32(exec)); 1349 if (exec->hadException()) 1350 return JSValue::encode(jsUndefined()); 1351 1352 int argsCount = exec->argumentCount(); 1353 if (argsCount <= 1) { 1354 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); 1355 return JSValue::encode(jsUndefined()); 1356 } 1357 1358 int opt1(exec->argument(1).toInt32(exec)); 1359 if (exec->hadException()) 1360 return JSValue::encode(jsUndefined()); 1361 int opt2(exec->argument(2).toInt32(exec)); 1362 if (exec->hadException()) 1363 return JSValue::encode(jsUndefined()); 1364 1365 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); 1366 return JSValue::encode(jsUndefined()); 1367} 1368 1369EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* exec) 1370{ 1371 JSValue thisValue = exec->hostThisValue(); 1372 if (!thisValue.inherits(&JSTestObj::s_info)) 1373 return throwVMTypeError(exec); 1374 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1375 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1376 if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) { 1377 setDOMException(exec, TYPE_MISMATCH_ERR); 1378 return JSValue::encode(jsUndefined()); 1379 } 1380 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); 1381 1382 imp->methodWithCallbackArg(callback); 1383 return JSValue::encode(jsUndefined()); 1384} 1385 1386EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec) 1387{ 1388 JSValue thisValue = exec->hostThisValue(); 1389 if (!thisValue.inherits(&JSTestObj::s_info)) 1390 return throwVMTypeError(exec); 1391 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1392 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1393 int nonCallback(exec->argument(0).toInt32(exec)); 1394 if (exec->hadException()) 1395 return JSValue::encode(jsUndefined()); 1396 if (exec->argumentCount() <= 1 || !exec->argument(1).isObject()) { 1397 setDOMException(exec, TYPE_MISMATCH_ERR); 1398 return JSValue::encode(jsUndefined()); 1399 } 1400 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject()); 1401 1402 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); 1403 return JSValue::encode(jsUndefined()); 1404} 1405 1406EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec) 1407{ 1408 JSValue thisValue = exec->hostThisValue(); 1409 if (!thisValue.inherits(&JSTestObj::s_info)) 1410 return throwVMTypeError(exec); 1411 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1412 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1413 RefPtr<TestCallback> callback; 1414 if (exec->argumentCount() > 0 && !exec->argument(0).isNull() && !exec->argument(0).isUndefined()) { 1415 if (!exec->argument(0).isObject()) { 1416 setDOMException(exec, TYPE_MISMATCH_ERR); 1417 return JSValue::encode(jsUndefined()); 1418 } 1419 callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); 1420 } 1421 1422 imp->methodWithCallbackAndOptionalArg(callback); 1423 return JSValue::encode(jsUndefined()); 1424} 1425 1426static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec) 1427{ 1428 JSValue thisValue = exec->hostThisValue(); 1429 if (!thisValue.inherits(&JSTestObj::s_info)) 1430 return throwVMTypeError(exec); 1431 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1432 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1433 TestObj* objArg(toTestObj(exec->argument(0))); 1434 if (exec->hadException()) 1435 return JSValue::encode(jsUndefined()); 1436 const String& strArg(ustringToString(exec->argument(1).toString(exec))); 1437 if (exec->hadException()) 1438 return JSValue::encode(jsUndefined()); 1439 1440 imp->overloadedMethod(objArg, strArg); 1441 return JSValue::encode(jsUndefined()); 1442} 1443 1444static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec) 1445{ 1446 JSValue thisValue = exec->hostThisValue(); 1447 if (!thisValue.inherits(&JSTestObj::s_info)) 1448 return throwVMTypeError(exec); 1449 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1450 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1451 TestObj* objArg(toTestObj(exec->argument(0))); 1452 if (exec->hadException()) 1453 return JSValue::encode(jsUndefined()); 1454 1455 int argsCount = exec->argumentCount(); 1456 if (argsCount <= 1) { 1457 imp->overloadedMethod(objArg); 1458 return JSValue::encode(jsUndefined()); 1459 } 1460 1461 int intArg(exec->argument(1).toInt32(exec)); 1462 if (exec->hadException()) 1463 return JSValue::encode(jsUndefined()); 1464 1465 imp->overloadedMethod(objArg, intArg); 1466 return JSValue::encode(jsUndefined()); 1467} 1468 1469static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec) 1470{ 1471 JSValue thisValue = exec->hostThisValue(); 1472 if (!thisValue.inherits(&JSTestObj::s_info)) 1473 return throwVMTypeError(exec); 1474 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1475 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1476 const String& strArg(ustringToString(exec->argument(0).toString(exec))); 1477 if (exec->hadException()) 1478 return JSValue::encode(jsUndefined()); 1479 1480 imp->overloadedMethod(strArg); 1481 return JSValue::encode(jsUndefined()); 1482} 1483 1484static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec) 1485{ 1486 JSValue thisValue = exec->hostThisValue(); 1487 if (!thisValue.inherits(&JSTestObj::s_info)) 1488 return throwVMTypeError(exec); 1489 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1490 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1491 int intArg(exec->argument(0).toInt32(exec)); 1492 if (exec->hadException()) 1493 return JSValue::encode(jsUndefined()); 1494 1495 imp->overloadedMethod(intArg); 1496 return JSValue::encode(jsUndefined()); 1497} 1498 1499static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod5(ExecState* exec) 1500{ 1501 JSValue thisValue = exec->hostThisValue(); 1502 if (!thisValue.inherits(&JSTestObj::s_info)) 1503 return throwVMTypeError(exec); 1504 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1505 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1506 if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) { 1507 setDOMException(exec, TYPE_MISMATCH_ERR); 1508 return JSValue::encode(jsUndefined()); 1509 } 1510 RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); 1511 1512 imp->overloadedMethod(callback); 1513 return JSValue::encode(jsUndefined()); 1514} 1515 1516EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec) 1517{ 1518 if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject()))) 1519 return jsTestObjPrototypeFunctionOverloadedMethod1(exec); 1520 if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))) 1521 return jsTestObjPrototypeFunctionOverloadedMethod2(exec); 1522 if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject()))) 1523 return jsTestObjPrototypeFunctionOverloadedMethod3(exec); 1524 if (exec->argumentCount() == 1) 1525 return jsTestObjPrototypeFunctionOverloadedMethod4(exec); 1526 if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isObject()))) 1527 return jsTestObjPrototypeFunctionOverloadedMethod5(exec); 1528 return throwVMTypeError(exec); 1529} 1530 1531EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethod(ExecState* exec) 1532{ 1533 JSValue thisValue = exec->hostThisValue(); 1534 if (!thisValue.inherits(&JSTestObj::s_info)) 1535 return throwVMTypeError(exec); 1536 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1537 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1538 1539 imp->classMethod(); 1540 return JSValue::encode(jsUndefined()); 1541} 1542 1543EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithOptional(ExecState* exec) 1544{ 1545 JSValue thisValue = exec->hostThisValue(); 1546 if (!thisValue.inherits(&JSTestObj::s_info)) 1547 return throwVMTypeError(exec); 1548 JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue)); 1549 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1550 1551 int argsCount = exec->argumentCount(); 1552 if (argsCount <= 0) { 1553 1554 JSC::JSValue result = jsNumber(imp->classMethodWithOptional()); 1555 return JSValue::encode(result); 1556 } 1557 1558 int arg(exec->argument(0).toInt32(exec)); 1559 if (exec->hadException()) 1560 return JSValue::encode(jsUndefined()); 1561 1562 1563 JSC::JSValue result = jsNumber(imp->classMethodWithOptional(arg)); 1564 return JSValue::encode(result); 1565} 1566 1567// Constant getters 1568 1569JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, const Identifier&) 1570{ 1571 UNUSED_PARAM(exec); 1572 return jsNumber(static_cast<int>(0)); 1573} 1574 1575JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, const Identifier&) 1576{ 1577 UNUSED_PARAM(exec); 1578 return jsNumber(static_cast<int>(1)); 1579} 1580 1581JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, const Identifier&) 1582{ 1583 UNUSED_PARAM(exec); 1584 return jsNumber(static_cast<int>(2)); 1585} 1586 1587JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, const Identifier&) 1588{ 1589 UNUSED_PARAM(exec); 1590 return jsNumber(static_cast<int>(4)); 1591} 1592 1593JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, const Identifier&) 1594{ 1595 UNUSED_PARAM(exec); 1596 return jsNumber(static_cast<int>(8)); 1597} 1598 1599JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, const Identifier&) 1600{ 1601 UNUSED_PARAM(exec); 1602 return jsNumber(static_cast<int>(-1)); 1603} 1604 1605JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, const Identifier&) 1606{ 1607 return jsStringOrNull(exec, String("my constant string")); 1608} 1609 1610JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, const Identifier&) 1611{ 1612 UNUSED_PARAM(exec); 1613 return jsNumber(static_cast<int>(0xffffffff)); 1614} 1615 1616JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, const Identifier&) 1617{ 1618 UNUSED_PARAM(exec); 1619 return jsNumber(static_cast<int>(0x01)); 1620} 1621 1622JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, const Identifier&) 1623{ 1624 UNUSED_PARAM(exec); 1625 return jsNumber(static_cast<int>(0X20)); 1626} 1627 1628JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, const Identifier&) 1629{ 1630 UNUSED_PARAM(exec); 1631 return jsNumber(static_cast<int>(0x1abc)); 1632} 1633 1634JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object) 1635{ 1636 return getDOMObjectWrapper<JSTestObj>(exec, globalObject, object); 1637} 1638TestObj* toTestObj(JSC::JSValue value) 1639{ 1640 return value.inherits(&JSTestObj::s_info) ? static_cast<JSTestObj*>(asObject(value))->impl() : 0; 1641} 1642 1643} 1644