| /* |
| This file is part of the WebKit open source project. |
| This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| |
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Library General Public |
| License as published by the Free Software Foundation; either |
| version 2 of the License, or (at your option) any later version. |
| |
| This library is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| Library General Public License for more details. |
| |
| You should have received a copy of the GNU Library General Public License |
| along with this library; see the file COPYING.LIB. If not, write to |
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| Boston, MA 02110-1301, USA. |
| */ |
| |
| #include "config.h" |
| #include "JSTestObj.h" |
| |
| #include "CallbackFunction.h" |
| #include "DOMStringList.h" |
| #include "Dictionary.h" |
| #include "Document.h" |
| #include "ExceptionCode.h" |
| #include "Frame.h" |
| #include "HTMLNames.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMStringList.h" |
| #include "JSDocument.h" |
| #include "JSEventListener.h" |
| #include "JSFloat32Array.h" |
| #include "JSNode.h" |
| #include "JSSVGDocument.h" |
| #include "JSSVGPoint.h" |
| #include "JSScriptProfile.h" |
| #include "JSTestCallback.h" |
| #include "JSTestNode.h" |
| #include "JSTestObj.h" |
| #include "JSTestSubObj.h" |
| #include "JSbool.h" |
| #include "KURL.h" |
| #include "SVGDocument.h" |
| #include "SVGPoint.h" |
| #include "SVGStaticPropertyTearOff.h" |
| #include "ScriptArguments.h" |
| #include "ScriptCallStackFactory.h" |
| #include "ScriptProfile.h" |
| #include "SerializedScriptValue.h" |
| #include "Settings.h" |
| #include "TestObj.h" |
| #include "bool.h" |
| #include <runtime/Error.h> |
| #include <runtime/JSArray.h> |
| #include <runtime/JSString.h> |
| #include <wtf/Float32Array.h> |
| #include <wtf/GetPtr.h> |
| |
| #if ENABLE(Condition1) |
| #include "JSTestObjectA.h" |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| #include "JSTestObjectB.h" |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| #include "JSTestObjectC.h" |
| #endif |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| /* Hash table */ |
| |
| static const HashTableValue JSTestObjTableValues[] = |
| { |
| { "readOnlyLongAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyLongAttr), (intptr_t)0, NoIntrinsic }, |
| { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0, NoIntrinsic }, |
| { "readOnlyTestObjAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0, NoIntrinsic }, |
| { "TestSubObjEnabledBySetting", DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestSubObjEnabledBySettingConstructor), (intptr_t)setJSTestObjTestSubObjEnabledBySettingConstructor, NoIntrinsic }, |
| { "enumAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjEnumAttr), (intptr_t)setJSTestObjEnumAttr, NoIntrinsic }, |
| { "byteAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjByteAttr), (intptr_t)setJSTestObjByteAttr, NoIntrinsic }, |
| { "octetAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjOctetAttr), (intptr_t)setJSTestObjOctetAttr, NoIntrinsic }, |
| { "shortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjShortAttr), (intptr_t)setJSTestObjShortAttr, NoIntrinsic }, |
| { "unsignedShortAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedShortAttr), (intptr_t)setJSTestObjUnsignedShortAttr, NoIntrinsic }, |
| { "longAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongAttr), (intptr_t)setJSTestObjLongAttr, NoIntrinsic }, |
| { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr, NoIntrinsic }, |
| { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr, NoIntrinsic }, |
| { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr, NoIntrinsic }, |
| { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr, NoIntrinsic }, |
| { "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr, NoIntrinsic }, |
| { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate, NoIntrinsic }, |
| { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr, NoIntrinsic }, |
| { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr, NoIntrinsic }, |
| { "reflectedUnsignedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedUnsignedIntegralAttr), (intptr_t)setJSTestObjReflectedUnsignedIntegralAttr, NoIntrinsic }, |
| { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr, NoIntrinsic }, |
| { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr, NoIntrinsic }, |
| { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr, NoIntrinsic }, |
| { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr, NoIntrinsic }, |
| { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr, NoIntrinsic }, |
| { "reflectedCustomURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t)setJSTestObjReflectedCustomURLAttr, NoIntrinsic }, |
| { "typedArrayAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTypedArrayAttr), (intptr_t)setJSTestObjTypedArrayAttr, NoIntrinsic }, |
| { "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException, NoIntrinsic }, |
| { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException, NoIntrinsic }, |
| { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException, NoIntrinsic }, |
| { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException, NoIntrinsic }, |
| { "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr, NoIntrinsic }, |
| { "withScriptStateAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttribute), (intptr_t)setJSTestObjWithScriptStateAttribute, NoIntrinsic }, |
| { "withScriptExecutionContextAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAttribute, NoIntrinsic }, |
| { "withScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptStateAttributeRaises, NoIntrinsic }, |
| { "withScriptExecutionContextAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAttributeRaises, NoIntrinsic }, |
| { "withScriptExecutionContextAndScriptStateAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttribute, NoIntrinsic }, |
| { "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises, NoIntrinsic }, |
| { "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute, NoIntrinsic }, |
| { "withScriptArgumentsAndCallStackAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t)setJSTestObjWithScriptArgumentsAndCallStackAttribute, NoIntrinsic }, |
| #if ENABLE(Condition1) |
| { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) |
| { "conditionalAttr4", DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t)setJSTestObjConditionalAttr4Constructor, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| { "conditionalAttr5", DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr5Constructor), (intptr_t)setJSTestObjConditionalAttr5Constructor, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| { "conditionalAttr6", DontEnum, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr6Constructor), (intptr_t)setJSTestObjConditionalAttr6Constructor, NoIntrinsic }, |
| #endif |
| { "cachedAttribute1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t)0, NoIntrinsic }, |
| { "cachedAttribute2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t)0, NoIntrinsic }, |
| { "anyAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAnyAttribute), (intptr_t)setJSTestObjAnyAttribute, NoIntrinsic }, |
| { "contentDocument", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t)0, NoIntrinsic }, |
| { "mutablePoint", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMutablePoint), (intptr_t)setJSTestObjMutablePoint, NoIntrinsic }, |
| { "immutablePoint", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImmutablePoint), (intptr_t)setJSTestObjImmutablePoint, NoIntrinsic }, |
| { "strawberry", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrawberry), (intptr_t)setJSTestObjStrawberry, NoIntrinsic }, |
| { "strictFloat", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictFloat), (intptr_t)setJSTestObjStrictFloat, NoIntrinsic }, |
| { "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0, NoIntrinsic }, |
| { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId, NoIntrinsic }, |
| { "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0, NoIntrinsic }, |
| { "replaceableAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReplaceableAttribute), (intptr_t)setJSTestObjReplaceableAttribute, NoIntrinsic }, |
| { "nullableDoubleAttribute", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableDoubleAttribute), (intptr_t)0, NoIntrinsic }, |
| { "nullableLongAttribute", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongAttribute), (intptr_t)0, NoIntrinsic }, |
| { "nullableBooleanAttribute", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableBooleanAttribute), (intptr_t)0, NoIntrinsic }, |
| { "nullableStringAttribute", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringAttribute), (intptr_t)0, NoIntrinsic }, |
| { "nullableLongSettableAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongSettableAttribute), (intptr_t)setJSTestObjNullableLongSettableAttribute, NoIntrinsic }, |
| { "nullableStringValue", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringValue), (intptr_t)setJSTestObjNullableStringValue, NoIntrinsic }, |
| { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t)0, NoIntrinsic }, |
| { 0, 0, 0, 0, NoIntrinsic } |
| }; |
| |
| static const HashTable JSTestObjTable = { 265, 255, JSTestObjTableValues, 0 }; |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSTestObjConstructorTableValues[] = |
| { |
| #if ENABLE(Condition1) |
| { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0, NoIntrinsic }, |
| #endif |
| { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0, NoIntrinsic }, |
| { "CONST_JAVASCRIPT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0, NoIntrinsic }, |
| { "staticReadOnlyLongAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t)0, NoIntrinsic }, |
| { "staticStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t)setJSTestObjConstructorStaticStringAttr, NoIntrinsic }, |
| { "TestSubObj", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorTestSubObj), (intptr_t)0, NoIntrinsic }, |
| { "staticMethodWithCallbackAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg), (intptr_t)0, NoIntrinsic }, |
| { "staticMethodWithCallbackArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackArg), (intptr_t)1, NoIntrinsic }, |
| { "classMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod), (intptr_t)0, NoIntrinsic }, |
| { "classMethodWithOptional", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethodWithOptional), (intptr_t)0, NoIntrinsic }, |
| { "classMethod2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod2), (intptr_t)1, NoIntrinsic }, |
| #if ENABLE(Condition1) |
| { "overloadedMethod1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionOverloadedMethod1), (intptr_t)1, NoIntrinsic }, |
| #endif |
| { 0, 0, 0, 0, NoIntrinsic } |
| }; |
| |
| static const HashTable JSTestObjConstructorTable = { 38, 31, JSTestObjConstructorTableValues, 0 }; |
| |
| #if ENABLE(Condition1) |
| COMPILE_ASSERT(0 == TestObj::CONDITIONAL_CONST, TestObjEnumCONDITIONAL_CONSTIsWrongUseDoNotCheckConstants); |
| #endif |
| COMPILE_ASSERT(0 == TestObj::CONST_VALUE_0, TestObjEnumCONST_VALUE_0IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(1 == TestObj::CONST_VALUE_1, TestObjEnumCONST_VALUE_1IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(2 == TestObj::CONST_VALUE_2, TestObjEnumCONST_VALUE_2IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(4 == TestObj::CONST_VALUE_4, TestObjEnumCONST_VALUE_4IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(8 == TestObj::CONST_VALUE_8, TestObjEnumCONST_VALUE_8IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(-1 == TestObj::CONST_VALUE_9, TestObjEnumCONST_VALUE_9IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT("my constant string" == TestObj::CONST_VALUE_10, TestObjEnumCONST_VALUE_10IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(0xffffffff == TestObj::CONST_VALUE_11, TestObjEnumCONST_VALUE_11IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(0x01 == TestObj::CONST_VALUE_12, TestObjEnumCONST_VALUE_12IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(0X20 == TestObj::CONST_VALUE_13, TestObjEnumCONST_VALUE_13IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWrongUseDoNotCheckConstants); |
| COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants); |
| |
| EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::constructJSTestObj(ExecState* exec) |
| { |
| JSTestObjConstructor* castedThis = jsCast<JSTestObjConstructor*>(exec->callee()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); |
| RefPtr<TestObj> object = TestObj::create(testCallback); |
| return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get()))); |
| } |
| |
| const ClassInfo JSTestObjConstructor::s_info = { "TestObjectConstructor", &Base::s_info, &JSTestObjConstructorTable, 0, CREATE_METHOD_TABLE(JSTestObjConstructor) }; |
| |
| JSTestObjConstructor::JSTestObjConstructor(Structure* structure, JSDOMGlobalObject* globalObject) |
| : DOMConstructorObject(structure, globalObject) |
| { |
| } |
| |
| void JSTestObjConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) |
| { |
| Base::finishCreation(exec->vm()); |
| ASSERT(inherits(&s_info)); |
| putDirect(exec->vm(), exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
| putDirect(exec->vm(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum); |
| } |
| |
| bool JSTestObjConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) |
| { |
| return getStaticPropertySlot<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, jsCast<JSTestObjConstructor*>(object), propertyName, slot); |
| } |
| |
| bool JSTestObjConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) |
| { |
| return getStaticPropertyDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, jsCast<JSTestObjConstructor*>(object), propertyName, descriptor); |
| } |
| |
| ConstructType JSTestObjConstructor::getConstructData(JSCell*, ConstructData& constructData) |
| { |
| constructData.native.function = constructJSTestObj; |
| return ConstructTypeHost; |
| } |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSTestObjPrototypeTableValues[] = |
| { |
| #if ENABLE(Condition1) |
| { "CONDITIONAL_CONST", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t)0, NoIntrinsic }, |
| #endif |
| { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_4", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_8", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_9", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_10", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_11", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_12", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_13", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t)0, NoIntrinsic }, |
| { "CONST_VALUE_14", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t)0, NoIntrinsic }, |
| { "CONST_JAVASCRIPT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t)0, NoIntrinsic }, |
| { "voidMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0, NoIntrinsic }, |
| { "voidMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3, NoIntrinsic }, |
| { "byteMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethod), (intptr_t)0, NoIntrinsic }, |
| { "byteMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethodWithArgs), (intptr_t)3, NoIntrinsic }, |
| { "octetMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOctetMethod), (intptr_t)0, NoIntrinsic }, |
| { "octetMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOctetMethodWithArgs), (intptr_t)3, NoIntrinsic }, |
| { "longMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethod), (intptr_t)0, NoIntrinsic }, |
| { "longMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethodWithArgs), (intptr_t)3, NoIntrinsic }, |
| { "objMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t)0, NoIntrinsic }, |
| { "objMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t)3, NoIntrinsic }, |
| { "methodWithSequenceArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t)1, NoIntrinsic }, |
| { "methodReturningSequence", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodReturningSequence), (intptr_t)1, NoIntrinsic }, |
| { "methodWithEnumArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithEnumArg), (intptr_t)1, NoIntrinsic }, |
| { "methodThatRequiresAllArgsAndThrows", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t)2, NoIntrinsic }, |
| { "serializedValue", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1, NoIntrinsic }, |
| { "optionsObject", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t)1, NoIntrinsic }, |
| { "methodWithException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0, NoIntrinsic }, |
| { "customMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0, NoIntrinsic }, |
| { "customMethodWithArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3, NoIntrinsic }, |
| { "addEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)2, NoIntrinsic }, |
| { "removeEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)2, NoIntrinsic }, |
| { "withScriptStateVoid", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0, NoIntrinsic }, |
| { "withScriptStateObj", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0, NoIntrinsic }, |
| { "withScriptStateVoidException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0, NoIntrinsic }, |
| { "withScriptStateObjException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0, NoIntrinsic }, |
| { "withScriptExecutionContext", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t)0, NoIntrinsic }, |
| { "withScriptExecutionContextAndScriptState", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState), (intptr_t)0, NoIntrinsic }, |
| { "withScriptExecutionContextAndScriptStateObjException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException), (intptr_t)0, NoIntrinsic }, |
| { "withScriptExecutionContextAndScriptStateWithSpaces", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t)0, NoIntrinsic }, |
| { "withScriptArgumentsAndCallStack", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t)0, NoIntrinsic }, |
| { "methodWithOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)0, NoIntrinsic }, |
| { "methodWithNonOptionalArgAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)1, NoIntrinsic }, |
| { "methodWithNonOptionalArgAndTwoOptionalArgs", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t)1, NoIntrinsic }, |
| { "methodWithOptionalString", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalString), (intptr_t)0, NoIntrinsic }, |
| { "methodWithOptionalStringIsUndefined", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined), (intptr_t)0, NoIntrinsic }, |
| { "methodWithOptionalStringIsNullString", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString), (intptr_t)0, NoIntrinsic }, |
| { "methodWithCallbackArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t)1, NoIntrinsic }, |
| { "methodWithNonCallbackArgAndCallbackArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t)2, NoIntrinsic }, |
| { "methodWithCallbackAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t)0, NoIntrinsic }, |
| #if ENABLE(Condition1) |
| { "conditionalMethod1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod1), (intptr_t)0, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| { "conditionalMethod2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod2), (intptr_t)0, NoIntrinsic }, |
| #endif |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| { "conditionalMethod3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t)0, NoIntrinsic }, |
| #endif |
| { "overloadedMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2, NoIntrinsic }, |
| { "classMethodWithClamp", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethodWithClamp), (intptr_t)2, NoIntrinsic }, |
| { "methodWithUnsignedLongSequence", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence), (intptr_t)1, NoIntrinsic }, |
| { "stringArrayFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStringArrayFunction), (intptr_t)1, NoIntrinsic }, |
| { "domStringListFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionDomStringListFunction), (intptr_t)1, NoIntrinsic }, |
| { "getSVGDocument", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t)0, NoIntrinsic }, |
| { "convert1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t)1, NoIntrinsic }, |
| { "convert2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t)1, NoIntrinsic }, |
| { "convert4", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t)1, NoIntrinsic }, |
| { "convert5", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t)1, NoIntrinsic }, |
| { "mutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t)0, NoIntrinsic }, |
| { "immutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t)0, NoIntrinsic }, |
| { "orange", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t)0, NoIntrinsic }, |
| { "strictFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunction), (intptr_t)3, NoIntrinsic }, |
| { "variadicStringMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicStringMethod), (intptr_t)2, NoIntrinsic }, |
| { "variadicDoubleMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t)2, NoIntrinsic }, |
| { "variadicNodeMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t)2, NoIntrinsic }, |
| { 0, 0, 0, 0, NoIntrinsic } |
| }; |
| |
| static const HashTable JSTestObjPrototypeTable = { 267, 255, JSTestObjPrototypeTableValues, 0 }; |
| const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) }; |
| |
| JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSTestObj>(exec, globalObject); |
| } |
| |
| bool JSTestObjPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) |
| { |
| JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(object); |
| return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, slot); |
| } |
| |
| bool JSTestObjPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) |
| { |
| JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(object); |
| return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, descriptor); |
| } |
| |
| const ClassInfo JSTestObj::s_info = { "TestObject", &Base::s_info, &JSTestObjTable, 0 , CREATE_METHOD_TABLE(JSTestObj) }; |
| |
| JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl) |
| : JSDOMWrapper(structure, globalObject) |
| , m_impl(impl.leakRef()) |
| { |
| } |
| |
| void JSTestObj::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| ASSERT(inherits(&s_info)); |
| } |
| |
| JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
| { |
| return JSTestObjPrototype::create(exec->vm(), globalObject, JSTestObjPrototype::createStructure(globalObject->vm(), globalObject, globalObject->objectPrototype())); |
| } |
| |
| void JSTestObj::destroy(JSC::JSCell* cell) |
| { |
| JSTestObj* thisObject = static_cast<JSTestObj*>(cell); |
| thisObject->JSTestObj::~JSTestObj(); |
| } |
| |
| JSTestObj::~JSTestObj() |
| { |
| releaseImplIfNotNull(); |
| } |
| |
| bool JSTestObj::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) |
| { |
| JSTestObj* thisObject = jsCast<JSTestObj*>(object); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); |
| return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, slot); |
| } |
| |
| bool JSTestObj::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) |
| { |
| JSTestObj* thisObject = jsCast<JSTestObj*>(object); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); |
| return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, descriptor); |
| } |
| |
| JSValue jsTestObjReadOnlyLongAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->readOnlyLongAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->readOnlyStringAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->readOnlyTestObjAttr())); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| UNUSED_PARAM(slotBase); |
| UNUSED_PARAM(exec); |
| JSValue result = jsNumber(TestObj::staticReadOnlyLongAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| UNUSED_PARAM(slotBase); |
| UNUSED_PARAM(exec); |
| JSValue result = jsStringWithCache(exec, TestObj::staticStringAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjConstructorTestSubObj(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| return JSTestSubObj::getConstructor(exec, castedThis->globalObject()); |
| } |
| |
| |
| JSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| Settings* settings = castedThis->impl()->frame() ? castedThis->impl()->frame()->settings() : 0; |
| if (!settings || !settings->testSettingEnabled()) |
| return jsUndefined(); |
| return JSTestSubObj::getConstructor(exec, castedThis->globalObject()); |
| } |
| |
| |
| JSValue jsTestObjEnumAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->enumAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjByteAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->byteAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjOctetAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->octetAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjShortAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->shortAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->unsignedShortAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjLongAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->longAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->longLongAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->unsignedLongLongAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->stringAttr()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->testObjAttr())); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjXMLObjAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->xmlObjAttr())); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjCreate(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsBoolean(impl->isCreate()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->fastGetAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(std::max(0, impl->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr))); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsBoolean(impl->fastHasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->fastGetAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsBoolean(impl->fastHasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjTypedArrayAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->typedArrayAttr())); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ExceptionCode ec = 0; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSC::JSValue result = jsNumber(impl->attrWithGetterException(ec)); |
| setDOMException(exec, ec); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->attrWithSetterException()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ExceptionCode ec = 0; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSC::JSValue result = jsStringWithCache(exec, impl->stringAttrWithGetterException(ec)); |
| setDOMException(exec, ec); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->stringAttrWithSetterException()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| return castedThis->customAttr(exec); |
| } |
| |
| |
| JSValue jsTestObjWithScriptStateAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->withScriptStateAttribute(exec)); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return jsUndefined(); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttribute(scriptContext))); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ExceptionCode ec = 0; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateAttributeRaises(exec, ec))); |
| setDOMException(exec, ec); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ExceptionCode ec = 0; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return jsUndefined(); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttributeRaises(scriptContext, ec))); |
| setDOMException(exec, ec); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return jsUndefined(); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext))); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ExceptionCode ec = 0; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return jsUndefined(); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec))); |
| setDOMException(exec, ec); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return jsUndefined(); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext))); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptArgumentsAndCallStackAttribute())); |
| return result; |
| } |
| |
| |
| #if ENABLE(Condition1) |
| JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->conditionalAttr1()); |
| return result; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->conditionalAttr2()); |
| return result; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->conditionalAttr3()); |
| return result; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) |
| JSValue jsTestObjConditionalAttr4Constructor(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| return JSTestObjectA::getConstructor(exec, castedThis->globalObject()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| JSValue jsTestObjConditionalAttr5Constructor(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| return JSTestObjectB::getConstructor(exec, castedThis->globalObject()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| JSValue jsTestObjConditionalAttr6Constructor(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| return JSTestObjectC::getConstructor(exec, castedThis->globalObject()); |
| } |
| |
| #endif |
| |
| JSValue jsTestObjCachedAttribute1(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| if (JSValue cachedValue = castedThis->m_cachedAttribute1.get()) |
| return cachedValue; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = (impl->cachedAttribute1().hasNoValue() ? jsNull() : impl->cachedAttribute1().jsValue()); |
| castedThis->m_cachedAttribute1.set(exec->vm(), castedThis, result); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjCachedAttribute2(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| if (JSValue cachedValue = castedThis->m_cachedAttribute2.get()) |
| return cachedValue; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = (impl->cachedAttribute2().hasNoValue() ? jsNull() : impl->cachedAttribute2().jsValue()); |
| castedThis->m_cachedAttribute2.set(exec->vm(), castedThis, result); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjAnyAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = (impl->anyAttribute().hasNoValue() ? jsNull() : impl->anyAttribute().jsValue()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjContentDocument(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| return shouldAllowAccessToNode(exec, impl->contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->contentDocument())) : jsNull(); |
| } |
| |
| |
| JSValue jsTestObjMutablePoint(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl->mutablePoint(), &TestObj::updateMutablePoint))); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjImmutablePoint(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(impl->immutablePoint()))); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjStrawberry(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->blueberry()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjStrictFloat(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->strictFloat()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->description()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjId(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->id()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjHash(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->hash()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjReplaceableAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->replaceableAttribute()); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjNullableDoubleAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->nullableDoubleAttribute(isNull)); |
| if (isNull) |
| return jsNull(); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjNullableLongAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->nullableLongAttribute(isNull)); |
| if (isNull) |
| return jsNull(); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjNullableBooleanAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsBoolean(impl->nullableBooleanAttribute(isNull)); |
| if (isNull) |
| return jsNull(); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjNullableStringAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsStringWithCache(exec, impl->nullableStringAttribute(isNull)); |
| if (isNull) |
| return jsNull(); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjNullableLongSettableAttribute(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue result = jsNumber(impl->nullableLongSettableAttribute(isNull)); |
| if (isNull) |
| return jsNull(); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjNullableStringValue(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); |
| ExceptionCode ec = 0; |
| bool isNull = false; |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSC::JSValue result = jsNumber(impl->nullableStringValue(isNull, ec)); |
| if (isNull) |
| return jsNull(); |
| setDOMException(exec, ec); |
| return result; |
| } |
| |
| |
| JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, PropertyName) |
| { |
| JSTestObj* domObject = jsCast<JSTestObj*>(asObject(slotBase)); |
| return JSTestObj::getConstructor(exec, domObject->globalObject()); |
| } |
| |
| void JSTestObj::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) |
| { |
| JSTestObj* thisObject = jsCast<JSTestObj*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); |
| lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, thisObject, slot); |
| } |
| |
| void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject*, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return; |
| TestObj::setStaticStringAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| // Shadowing a built-in constructor |
| jsCast<JSTestObj*>(thisObject)->putDirect(exec->vm(), Identifier(exec, "TestSubObjEnabledBySetting"), value); |
| } |
| |
| |
| void setJSTestObjEnumAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return; |
| if (nativeValue != "" && nativeValue != "EnumValue1" && nativeValue != "EnumValue2" && nativeValue != "EnumValue3") |
| return; |
| impl->setEnumAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjByteAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int8_t nativeValue(toInt8(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setByteAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjOctetAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| uint8_t nativeValue(toUInt8(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setOctetAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjShortAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| short nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setShortAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| unsigned short nativeValue(toUInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setUnsignedShortAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setLongAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| long long nativeValue(toInt64(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setLongLongAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| unsigned long long nativeValue(toUInt64(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setUnsignedLongLongAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setStringAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl->setTestObjAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl->setXMLObjAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjCreate(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| bool nativeValue(value.toBoolean(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setCreate(nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| unsigned nativeValue(toUInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| bool nativeValue(value.toBoolean(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| bool nativeValue(value.toBoolean(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjTypedArrayAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| Float32Array* nativeValue(toFloat32Array(value)); |
| if (exec->hadException()) |
| return; |
| impl->setTypedArrayAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setAttrWithGetterException(nativeValue); |
| } |
| |
| |
| void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setAttrWithSetterException(nativeValue, ec); |
| setDOMException(exec, ec); |
| } |
| |
| |
| void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setStringAttrWithGetterException(nativeValue); |
| } |
| |
| |
| void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setStringAttrWithSetterException(nativeValue, ec); |
| setDOMException(exec, ec); |
| } |
| |
| |
| void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| jsCast<JSTestObj*>(thisObject)->setCustomAttr(exec, value); |
| } |
| |
| |
| void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setWithScriptStateAttribute(exec, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return; |
| impl->setWithScriptExecutionContextAttribute(scriptContext, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl->setWithScriptStateAttributeRaises(exec, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return; |
| impl->setWithScriptExecutionContextAttributeRaises(scriptContext, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return; |
| impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return; |
| impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return; |
| impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl->setWithScriptArgumentsAndCallStackAttribute(nativeValue); |
| } |
| |
| |
| #if ENABLE(Condition1) |
| void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setConditionalAttr1(nativeValue); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setConditionalAttr2(nativeValue); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setConditionalAttr3(nativeValue); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) |
| void setJSTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| // Shadowing a built-in constructor |
| jsCast<JSTestObj*>(thisObject)->putDirect(exec->vm(), Identifier(exec, "conditionalAttr4"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| void setJSTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| // Shadowing a built-in constructor |
| jsCast<JSTestObj*>(thisObject)->putDirect(exec->vm(), Identifier(exec, "conditionalAttr5"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| // Shadowing a built-in constructor |
| jsCast<JSTestObj*>(thisObject)->putDirect(exec->vm(), Identifier(exec, "conditionalAttr6"), value); |
| } |
| |
| #endif |
| |
| void setJSTestObjAnyAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ScriptValue nativeValue(exec->vm(), value); |
| if (exec->hadException()) |
| return; |
| impl->setAnyAttribute(nativeValue); |
| } |
| |
| |
| void setJSTestObjMutablePoint(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| SVGPropertyTearOff<SVGPoint>* nativeValue(toSVGPoint(value)); |
| if (exec->hadException()) |
| return; |
| impl->setMutablePoint(nativeValue); |
| } |
| |
| |
| void setJSTestObjImmutablePoint(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| SVGPropertyTearOff<SVGPoint>* nativeValue(toSVGPoint(value)); |
| if (exec->hadException()) |
| return; |
| impl->setImmutablePoint(nativeValue); |
| } |
| |
| |
| void setJSTestObjStrawberry(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setBlueberry(nativeValue); |
| } |
| |
| |
| void setJSTestObjStrictFloat(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| float nativeValue(value.toFloat(exec)); |
| if (exec->hadException()) |
| return; |
| impl->setStrictFloat(nativeValue); |
| } |
| |
| |
| void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setId(nativeValue); |
| } |
| |
| |
| void setJSTestObjReplaceableAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| // Shadowing a built-in object |
| jsCast<JSTestObj*>(thisObject)->putDirect(exec->vm(), Identifier(exec, "replaceableAttribute"), value); |
| } |
| |
| |
| void setJSTestObjNullableLongSettableAttribute(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setNullableLongSettableAttribute(nativeValue); |
| } |
| |
| |
| void setJSTestObjNullableStringValue(ExecState* exec, JSObject* thisObject, JSValue value) |
| { |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl->setNullableStringValue(nativeValue); |
| } |
| |
| |
| JSValue JSTestObj::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSTestObjConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| impl->voidMethod(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 3) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int longArg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg(toTestObj(exec->argument(2))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->voidMethodWithArgs(longArg, strArg, objArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionByteMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = jsNumber(impl->byteMethod()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionByteMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 3) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int8_t byteArg(toInt8(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg(toTestObj(exec->argument(2))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = jsNumber(impl->byteMethodWithArgs(byteArg, strArg, objArg)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOctetMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = jsNumber(impl->octetMethod()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOctetMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 3) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| uint8_t octetArg(toUInt8(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg(toTestObj(exec->argument(2))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = jsNumber(impl->octetMethodWithArgs(octetArg, strArg, objArg)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = jsNumber(impl->longMethod()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 3) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int longArg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg(toTestObj(exec->argument(2))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = jsNumber(impl->longMethodWithArgs(longArg, strArg, objArg)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->objMethod())); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 3) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int longArg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg(toTestObj(exec->argument(2))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->objMethodWithArgs(longArg, strArg, objArg))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Vector<RefPtr<ScriptProfile> > sequenceArg((toRefPtrNativeArray<ScriptProfile, JSScriptProfile>(exec, exec->argument(0), &toScriptProfile))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithSequenceArg(sequenceArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int longArg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = jsArray(exec, castedThis->globalObject(), impl->methodReturningSequence(longArg)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| const String enumArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| if (enumArg != "" && enumArg != "EnumValue1" && enumArg != "EnumValue2" && enumArg != "EnumValue3") |
| return throwVMTypeError(exec); |
| impl->methodWithEnumArg(enumArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| ExceptionCode ec = 0; |
| const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg(toTestObj(exec->argument(1))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0), 0, 0)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->serializedValue(serializedArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Dictionary oo(exec, exec->argument(0)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| Dictionary ooo(exec, exec->argument(1)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->optionsObject(oo, ooo); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| impl->methodWithException(ec); |
| setDOMException(exec, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| return JSValue::encode(castedThis->customMethod(exec)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| return JSValue::encode(castedThis->customMethodWithArgs(exec)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue listener = exec->argument(1); |
| if (!listener.isObject()) |
| return JSValue::encode(jsUndefined()); |
| impl->addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| JSValue listener = exec->argument(1); |
| if (!listener.isObject()) |
| return JSValue::encode(jsUndefined()); |
| impl->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| impl->withScriptStateVoid(exec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateObj(exec))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| impl->withScriptStateVoidException(exec, ec); |
| setDOMException(exec, ec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateObjException(exec, ec))); |
| setDOMException(exec, ec); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| impl->withScriptExecutionContext(scriptContext); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| impl->withScriptExecutionContextAndScriptState(exec, scriptContext); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateObjException(exec, scriptContext, ec))); |
| setDOMException(exec, ec); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpaces(exec, scriptContext))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0)); |
| impl->withScriptArgumentsAndCallStack(scriptArguments.release()); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount <= 0) { |
| impl->methodWithOptionalArg(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| int opt(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithOptionalArg(opt); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int nonOpt(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount <= 1) { |
| impl->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| int opt(toInt32(exec, exec->argument(1), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int nonOpt(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount <= 1) { |
| impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| int opt1(toInt32(exec, exec->argument(1), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| if (argsCount <= 2) { |
| impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| int opt2(toInt32(exec, exec->argument(2), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount <= 0) { |
| impl->methodWithOptionalString(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithOptionalString(str); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithOptionalStringIsUndefined(str); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| const String& str(argumentOrNull(exec, 0).isEmpty() ? String() : argumentOrNull(exec, 0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithOptionalStringIsNullString(str); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); |
| impl->methodWithCallbackArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int nonCallback(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| if (exec->argumentCount() <= 1 || !exec->argument(1).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject()); |
| impl->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| RefPtr<TestCallback> callback; |
| if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull()) { |
| if (!exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); |
| } |
| impl->methodWithCallbackAndOptionalArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg(ExecState* exec) |
| { |
| RefPtr<TestCallback> callback; |
| if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull()) { |
| if (!exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| callback = createFunctionOnlyCallback<JSTestCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0)); |
| } |
| TestObj::staticMethodWithCallbackAndOptionalArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionStaticMethodWithCallbackArg(ExecState* exec) |
| { |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = createFunctionOnlyCallback<JSTestCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0)); |
| TestObj::staticMethodWithCallbackArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #if ENABLE(Condition1) |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod1(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = jsStringWithCache(exec, impl->conditionalMethod1()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod2(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| impl->conditionalMethod2(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod3(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| impl->conditionalMethod3(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestObj* objArg(toTestObj(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| const String& strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(objArg, strArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestObj* objArg(toTestObj(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount <= 1) { |
| impl->overloadedMethod(objArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| int longArg(toInt32(exec, exec->argument(1), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(objArg, longArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(strArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int longArg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(longArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod5(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| if (exec->argumentCount() <= 0 || !exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject()); |
| impl->overloadedMethod(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod6(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| RefPtr<DOMStringList> listArg(toDOMStringList(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(listArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod7(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(arrayArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod8(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestObj* objArg(toTestObj(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(objArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod9(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(arrayArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod10(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Vector<unsigned> arrayArg(toNativeArray<unsigned>(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(arrayArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod11(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| const String& strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->overloadedMethod(strArg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec) |
| { |
| size_t argsCount = exec->argumentCount(); |
| JSValue arg1(exec->argument(1)); |
| JSValue arg0(exec->argument(0)); |
| if ((argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info))) && (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject()))) |
| return jsTestObjPrototypeFunctionOverloadedMethod1(exec); |
| if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info)))) || (argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info))))) |
| return jsTestObjPrototypeFunctionOverloadedMethod2(exec); |
| if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject()))) |
| return jsTestObjPrototypeFunctionOverloadedMethod3(exec); |
| if (argsCount == 1) |
| return jsTestObjPrototypeFunctionOverloadedMethod4(exec); |
| if ((argsCount == 1 && (arg0.isNull() || arg0.isFunction()))) |
| return jsTestObjPrototypeFunctionOverloadedMethod5(exec); |
| if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(&JSDOMStringList::s_info))))) |
| return jsTestObjPrototypeFunctionOverloadedMethod6(exec); |
| if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && isJSArray(arg0))))) |
| return jsTestObjPrototypeFunctionOverloadedMethod7(exec); |
| if ((argsCount == 1 && (arg0.isObject() && asObject(arg0)->inherits(&JSTestObj::s_info)))) |
| return jsTestObjPrototypeFunctionOverloadedMethod8(exec); |
| if ((argsCount == 1 && (arg0.isObject() && isJSArray(arg0)))) |
| return jsTestObjPrototypeFunctionOverloadedMethod9(exec); |
| if ((argsCount == 1 && (arg0.isObject() && isJSArray(arg0)))) |
| return jsTestObjPrototypeFunctionOverloadedMethod10(exec); |
| if (argsCount == 1) |
| return jsTestObjPrototypeFunctionOverloadedMethod11(exec); |
| if (argsCount < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| return throwVMTypeError(exec); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(ExecState* exec) |
| { |
| TestObj::classMethod(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional(ExecState* exec) |
| { |
| |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount <= 0) { |
| |
| JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional()); |
| return JSValue::encode(result); |
| } |
| |
| int arg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = jsNumber(TestObj::classMethodWithOptional(arg)); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod2(ExecState* exec) |
| { |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| return JSValue::encode(JSTestObj::classMethod2(exec)); |
| } |
| |
| #if ENABLE(Condition1) |
| static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod11(ExecState* exec) |
| { |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| int arg(toInt32(exec, exec->argument(0), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj::overloadedMethod1(arg); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) |
| static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod12(ExecState* exec) |
| { |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| const String& type(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| TestObj::overloadedMethod1(type); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecState* exec) |
| { |
| size_t argsCount = exec->argumentCount(); |
| if (argsCount == 1) |
| return jsTestObjConstructorFunctionOverloadedMethod11(exec); |
| JSValue arg0(exec->argument(0)); |
| if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject()))) |
| return jsTestObjConstructorFunctionOverloadedMethod12(exec); |
| if (argsCount < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| return throwVMTypeError(exec); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithClamp(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| unsigned short objArgsShort = 0; |
| double objArgsShortNativeValue = exec->argument(0).toNumber(exec); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| if (!std::isnan(objArgsShortNativeValue)) |
| objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); |
| |
| unsigned long objArgsLong = 0; |
| double objArgsLongNativeValue = exec->argument(1).toNumber(exec); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| if (!std::isnan(objArgsLongNativeValue)) |
| objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); |
| |
| impl->classMethodWithClamp(objArgsShort, objArgsLong); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Vector<unsigned> unsignedLongSequence(toNativeArray<unsigned>(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->methodWithUnsignedLongSequence(unsignedLongSequence); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStringArrayFunction(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| ExceptionCode ec = 0; |
| Vector<String> values(toNativeArray<String>(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = jsArray(exec, castedThis->globalObject(), impl->stringArrayFunction(values, ec)); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionDomStringListFunction(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| ExceptionCode ec = 0; |
| RefPtr<DOMStringList> values(toDOMStringList(exec, exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->domStringListFunction(values, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| ExceptionCode ec = 0; |
| if (!shouldAllowAccessToNode(exec, impl->getSVGDocument(ec))) |
| return JSValue::encode(jsNull()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->getSVGDocument(ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestNode* value(toTestNode(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->convert1(value); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestNode* value(toTestNode(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->convert2(value); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestNode* value(toTestNode(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->convert4(value); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| TestNode* value(toTestNode(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->convert5(value); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(impl->mutablePointFunction()))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(impl->immutablePointFunction()))); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| impl->banana(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 3) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| ExceptionCode ec = 0; |
| const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| float a(exec->argument(1).toFloat(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| int b(toInt32(exec, exec->argument(2), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->strictFunction(str, a, b, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicStringMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| const String& head(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| Vector<String> tail = toNativeArguments<String>(exec, 1); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->variadicStringMethod(head, tail); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicDoubleMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| double head(exec->argument(0).toNumber(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| Vector<double> tail = toNativeArguments<double>(exec, 1); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl->variadicDoubleMethod(head, tail); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicNodeMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| if (!thisValue.inherits(&JSTestObj::s_info)) |
| return throwVMTypeError(exec); |
| JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue)); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); |
| TestObj* impl = static_cast<TestObj*>(castedThis->impl()); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| Node* head(toNode(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| Vector<Node*> tail; |
| for (unsigned i = 1; i < exec->argumentCount(); ++i) { |
| if (!exec->argument(i).inherits(&JSNode::s_info)) |
| return throwVMTypeError(exec); |
| tail.append(toNode(exec->argument(i))); |
| } |
| impl->variadicNodeMethod(head, tail); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor) |
| { |
| JSTestObj* thisObject = jsCast<JSTestObj*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); |
| COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); |
| ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); |
| Base::visitChildren(thisObject, visitor); |
| visitor.append(&thisObject->m_cachedAttribute1); |
| visitor.append(&thisObject->m_cachedAttribute2); |
| } |
| |
| // Constant getters |
| |
| #if ENABLE(Condition1) |
| JSValue jsTestObjCONDITIONAL_CONST(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(0)); |
| } |
| |
| #endif |
| JSValue jsTestObjCONST_VALUE_0(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(0)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_1(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(1)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_2(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(2)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_4(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(4)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_8(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(8)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_9(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(-1)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_10(ExecState* exec, JSValue, PropertyName) |
| { |
| return jsStringOrNull(exec, String("my constant string")); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_11(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(0xffffffff)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_12(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(0x01)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_13(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(0X20)); |
| } |
| |
| JSValue jsTestObjCONST_VALUE_14(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(0x1abc)); |
| } |
| |
| JSValue jsTestObjCONST_JAVASCRIPT(ExecState* exec, JSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return jsNumber(static_cast<int>(15)); |
| } |
| |
| static inline bool isObservable(JSTestObj* jsTestObj) |
| { |
| if (jsTestObj->hasCustomProperties()) |
| return true; |
| return false; |
| } |
| |
| bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| JSTestObj* jsTestObj = jsCast<JSTestObj*>(handle.get().asCell()); |
| if (!isObservable(jsTestObj)) |
| return false; |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSTestObjOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| JSTestObj* jsTestObj = jsCast<JSTestObj*>(handle.get().asCell()); |
| DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, jsTestObj->impl(), jsTestObj); |
| jsTestObj->releaseImpl(); |
| } |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| #if PLATFORM(WIN) |
| #pragma warning(disable: 4483) |
| extern "C" { extern void (*const __identifier("??_7TestObj@WebCore@@6B@")[])(); } |
| #else |
| extern "C" { extern void* _ZTVN7WebCore7TestObjE[]; } |
| #endif |
| #endif |
| JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* impl) |
| { |
| if (!impl) |
| return jsNull(); |
| if (JSValue result = getExistingWrapper<JSTestObj>(exec, impl)) |
| return result; |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| void* actualVTablePointer = *(reinterpret_cast<void**>(impl)); |
| #if PLATFORM(WIN) |
| void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestObj@WebCore@@6B@")); |
| #else |
| void* expectedVTablePointer = &_ZTVN7WebCore7TestObjE[2]; |
| #if COMPILER(CLANG) |
| // If this fails TestObj does not have a vtable, so you need to add the |
| // ImplementationLacksVTable attribute to the interface definition |
| COMPILE_ASSERT(__is_polymorphic(TestObj), TestObj_is_not_polymorphic); |
| #endif |
| #endif |
| // If you hit this assertion you either have a use after free bug, or |
| // TestObj has subclasses. If TestObj has subclasses that get passed |
| // to toJS() we currently require TestObj you to opt out of binding hardening |
| // by adding the SkipVTableValidation attribute to the interface IDL definition |
| RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| #endif |
| ReportMemoryCost<TestObj>::reportMemoryCost(exec, impl); |
| return createNewWrapper<JSTestObj>(exec, globalObject, impl); |
| } |
| |
| TestObj* toTestObj(JSC::JSValue value) |
| { |
| return value.inherits(&JSTestObj::s_info) ? jsCast<JSTestObj*>(asObject(value))->impl() : 0; |
| } |
| |
| } |