| /* |
| 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 "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 "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 "URL.h" |
| #include "bool.h" |
| #include <runtime/Error.h> |
| #include <runtime/JSArray.h> |
| #include <runtime/JSString.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, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "readOnlyStringAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "readOnlyTestObjAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "TestSubObjEnabledBySetting", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestSubObjEnabledBySettingConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTestSubObjEnabledBySettingConstructor) }, |
| { "enumAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjEnumAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjEnumAttr) }, |
| { "byteAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjByteAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjByteAttr) }, |
| { "octetAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjOctetAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjOctetAttr) }, |
| { "shortAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjShortAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjShortAttr) }, |
| { "unsignedShortAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedShortAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjUnsignedShortAttr) }, |
| { "longAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjLongAttr) }, |
| { "longLongAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjLongLongAttr) }, |
| { "unsignedLongLongAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjUnsignedLongLongAttr) }, |
| { "stringAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttr) }, |
| { "testObjAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTestObjAttr) }, |
| { "XMLObjAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjXMLObjAttr) }, |
| { "create", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCreate) }, |
| { "reflectedStringAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedStringAttr) }, |
| { "reflectedIntegralAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedIntegralAttr) }, |
| { "reflectedUnsignedIntegralAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedUnsignedIntegralAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedUnsignedIntegralAttr) }, |
| { "reflectedBooleanAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedBooleanAttr) }, |
| { "reflectedURLAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedURLAttr) }, |
| { "reflectedStringAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedStringAttr) }, |
| { "reflectedCustomIntegralAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomIntegralAttr) }, |
| { "reflectedCustomBooleanAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomBooleanAttr) }, |
| { "reflectedCustomURLAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomURLAttr) }, |
| { "typedArrayAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTypedArrayAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTypedArrayAttr) }, |
| { "attrWithGetterException", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithGetterException) }, |
| { "attrWithSetterException", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithSetterException) }, |
| { "stringAttrWithGetterException", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithGetterException) }, |
| { "stringAttrWithSetterException", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithSetterException) }, |
| { "customAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjCustomAttr) }, |
| { "withScriptStateAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptStateAttribute) }, |
| { "withScriptExecutionContextAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAttribute) }, |
| { "withScriptStateAttributeRaises", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttributeRaises), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptStateAttributeRaises) }, |
| { "withScriptExecutionContextAttributeRaises", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttributeRaises), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAttributeRaises) }, |
| { "withScriptExecutionContextAndScriptStateAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAndScriptStateAttribute) }, |
| { "withScriptExecutionContextAndScriptStateAttributeRaises", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises) }, |
| { "withScriptExecutionContextAndScriptStateWithSpacesAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute) }, |
| { "withScriptArgumentsAndCallStackAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptArgumentsAndCallStackAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjWithScriptArgumentsAndCallStackAttribute) }, |
| #if ENABLE(Condition1) |
| { "conditionalAttr1", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr1) }, |
| #endif |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| { "conditionalAttr2", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr2) }, |
| #endif |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| { "conditionalAttr3", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr3) }, |
| #endif |
| #if ENABLE(Condition1) |
| { "conditionalAttr4", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr4Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr4Constructor) }, |
| #endif |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| { "conditionalAttr5", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr5Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr5Constructor) }, |
| #endif |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| { "conditionalAttr6", DontEnum, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr6Constructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConditionalAttr6Constructor) }, |
| #endif |
| { "cachedAttribute1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "cachedAttribute2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "anyAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAnyAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAnyAttribute) }, |
| { "contentDocument", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "mutablePoint", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMutablePoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjMutablePoint) }, |
| { "immutablePoint", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImmutablePoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjImmutablePoint) }, |
| { "strawberry", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrawberry), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrawberry) }, |
| { "strictFloat", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictFloat), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrictFloat) }, |
| { "description", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "id", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjId) }, |
| { "hash", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "replaceableAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReplaceableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReplaceableAttribute) }, |
| { "nullableDoubleAttribute", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableDoubleAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "nullableLongAttribute", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "nullableBooleanAttribute", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableBooleanAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "nullableStringAttribute", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "nullableLongSettableAttribute", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableLongSettableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjNullableLongSettableAttribute) }, |
| { "nullableStringValue", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjNullableStringValue) }, |
| { "attribute", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "attributeWithReservedEnumType", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithReservedEnumType) }, |
| { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { 0, 0, NoIntrinsic, 0, 0 } |
| }; |
| |
| static const HashTable JSTestObjTable = { 266, 255, true, JSTestObjTableValues, 0 }; |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSTestObjConstructorTableValues[] = |
| { |
| #if ENABLE(Condition1) |
| { "CONDITIONAL_CONST", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| #endif |
| { "CONST_VALUE_0", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_4", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_8", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_9", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_10", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_11", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_12", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_13", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_14", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_JAVASCRIPT", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "readonly", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadonly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "staticReadOnlyLongAttr", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticReadOnlyLongAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "staticStringAttr", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorStaticStringAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjConstructorStaticStringAttr) }, |
| { "TestSubObj", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "staticMethodWithCallbackAndOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg), (intptr_t) (0) }, |
| { "staticMethodWithCallbackArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionStaticMethodWithCallbackArg), (intptr_t) (1) }, |
| { "classMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod), (intptr_t) (0) }, |
| { "classMethodWithOptional", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethodWithOptional), (intptr_t) (0) }, |
| { "classMethod2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionClassMethod2), (intptr_t) (1) }, |
| #if ENABLE(Condition1) |
| { "overloadedMethod1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjConstructorFunctionOverloadedMethod1), (intptr_t) (1) }, |
| #endif |
| { 0, 0, NoIntrinsic, 0, 0 } |
| }; |
| |
| static const HashTable JSTestObjConstructorTable = { 39, 31, true, 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); |
| COMPILE_ASSERT(0 == TestObj::readonly, TestObjEnumreadonlyIsWrongUseDoNotCheckConstants); |
| |
| 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->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(exec->uncheckedArgument(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(VM& vm, JSDOMGlobalObject* globalObject) |
| { |
| Base::finishCreation(vm); |
| ASSERT(inherits(info())); |
| putDirect(vm, vm.propertyNames->prototype, JSTestObjPrototype::self(vm, globalObject), DontDelete | ReadOnly); |
| putDirect(vm, vm.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); |
| } |
| |
| 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, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONDITIONAL_CONST), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| #endif |
| { "CONST_VALUE_0", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_1", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_2", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_4", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_4), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_8", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_8), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_9", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_9), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_10", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_10), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_11", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_11), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_12", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_12), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_13", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_13), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_VALUE_14", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_14), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "CONST_JAVASCRIPT", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_JAVASCRIPT), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "readonly", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadonly), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) }, |
| { "voidMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t) (0) }, |
| { "voidMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t) (3) }, |
| { "byteMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethod), (intptr_t) (0) }, |
| { "byteMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethodWithArgs), (intptr_t) (3) }, |
| { "octetMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOctetMethod), (intptr_t) (0) }, |
| { "octetMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOctetMethodWithArgs), (intptr_t) (3) }, |
| { "longMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethod), (intptr_t) (0) }, |
| { "longMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionLongMethodWithArgs), (intptr_t) (3) }, |
| { "objMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethod), (intptr_t) (0) }, |
| { "objMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionObjMethodWithArgs), (intptr_t) (3) }, |
| { "methodWithSequenceArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) }, |
| { "methodReturningSequence", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodReturningSequence), (intptr_t) (1) }, |
| { "methodWithEnumArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithEnumArg), (intptr_t) (1) }, |
| { "methodThatRequiresAllArgsAndThrows", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t) (2) }, |
| { "serializedValue", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t) (1) }, |
| { "optionsObject", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t) (1) }, |
| { "methodWithException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t) (0) }, |
| { "customMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t) (0) }, |
| { "customMethodWithArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t) (3) }, |
| { "addEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t) (2) }, |
| { "removeEventListener", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t) (2) }, |
| { "withScriptStateVoid", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t) (0) }, |
| { "withScriptStateObj", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t) (0) }, |
| { "withScriptStateVoidException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t) (0) }, |
| { "withScriptStateObjException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t) (0) }, |
| { "withScriptExecutionContext", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t) (0) }, |
| { "withScriptExecutionContextAndScriptState", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState), (intptr_t) (0) }, |
| { "withScriptExecutionContextAndScriptStateObjException", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException), (intptr_t) (0) }, |
| { "withScriptExecutionContextAndScriptStateWithSpaces", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t) (0) }, |
| { "withScriptArgumentsAndCallStack", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t) (0) }, |
| { "methodWithOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t) (0) }, |
| { "methodWithNonOptionalArgAndOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t) (1) }, |
| { "methodWithNonOptionalArgAndTwoOptionalArgs", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t) (1) }, |
| { "methodWithOptionalString", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalString), (intptr_t) (0) }, |
| { "methodWithOptionalStringIsUndefined", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined), (intptr_t) (0) }, |
| { "methodWithOptionalStringIsNullString", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString), (intptr_t) (0) }, |
| { "methodWithCallbackArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t) (1) }, |
| { "methodWithNonCallbackArgAndCallbackArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t) (2) }, |
| { "methodWithCallbackAndOptionalArg", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t) (0) }, |
| #if ENABLE(Condition1) |
| { "conditionalMethod1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod1), (intptr_t) (0) }, |
| #endif |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| { "conditionalMethod2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod2), (intptr_t) (0) }, |
| #endif |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| { "conditionalMethod3", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t) (0) }, |
| #endif |
| { "overloadedMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t) (2) }, |
| { "classMethodWithClamp", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionClassMethodWithClamp), (intptr_t) (2) }, |
| { "methodWithUnsignedLongSequence", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence), (intptr_t) (1) }, |
| { "stringArrayFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStringArrayFunction), (intptr_t) (1) }, |
| { "domStringListFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionDomStringListFunction), (intptr_t) (1) }, |
| { "getSVGDocument", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t) (0) }, |
| { "convert1", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t) (1) }, |
| { "convert2", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t) (1) }, |
| { "convert4", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t) (1) }, |
| { "convert5", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t) (1) }, |
| { "mutablePointFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t) (0) }, |
| { "immutablePointFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t) (0) }, |
| { "orange", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t) (0) }, |
| { "strictFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunction), (intptr_t) (3) }, |
| { "strictFunctionWithSequence", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunctionWithSequence), (intptr_t) (2) }, |
| { "strictFunctionWithArray", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunctionWithArray), (intptr_t) (2) }, |
| { "variadicStringMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicStringMethod), (intptr_t) (2) }, |
| { "variadicDoubleMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t) (2) }, |
| { "variadicNodeMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t) (2) }, |
| { "any", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAny), (intptr_t) (2) }, |
| { 0, 0, NoIntrinsic, 0, 0 } |
| }; |
| |
| static const HashTable JSTestObjPrototypeTable = { 267, 255, true, JSTestObjPrototypeTableValues, 0 }; |
| const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) }; |
| |
| JSObject* JSTestObjPrototype::self(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSTestObj>(vm, 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); |
| } |
| |
| 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(info())); |
| } |
| |
| JSObject* JSTestObj::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSTestObjPrototype::create(vm, globalObject, JSTestObjPrototype::createStructure(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, info()); |
| return getStaticValueSlot<JSTestObj, Base>(exec, JSTestObjTable, thisObject, propertyName, slot); |
| } |
| |
| EncodedJSValue jsTestObjReadOnlyLongAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.readOnlyLongAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReadOnlyStringAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.readOnlyStringAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.readOnlyTestObjAttr())); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(thisValue); |
| UNUSED_PARAM(slotBase); |
| UNUSED_PARAM(exec); |
| JSValue result = jsNumber(TestObj::staticReadOnlyLongAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(thisValue); |
| UNUSED_PARAM(slotBase); |
| UNUSED_PARAM(exec); |
| JSValue result = jsStringWithCache(exec, TestObj::staticStringAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjConstructorTestSubObj(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| return JSValue::encode(JSTestSubObj::getConstructor(exec->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| if (!castedThis->impl().frame()) |
| return JSValue::encode(jsUndefined()); |
| Settings& settings = castedThis->impl().frame()->settings(); |
| if (!settings.testSettingEnabled()) |
| return JSValue::encode(jsUndefined()); |
| return JSValue::encode(JSTestSubObj::getConstructor(exec->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsTestObjEnumAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.enumAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjByteAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.byteAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjOctetAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.octetAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjShortAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.shortAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjUnsignedShortAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.unsignedShortAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjLongAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.longAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjLongLongAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.longLongAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.unsignedLongLongAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjStringAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.stringAttr()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjTestObjAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.testObjAttr())); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjXMLObjAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.xmlObjAttr())); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjCreate(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsBoolean(impl.isCreate()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedStringAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.fastGetAttribute(WebCore::HTMLNames::reflectedstringattrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedIntegralAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr))); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedBooleanAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedURLAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedStringAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.fastGetAttribute(WebCore::HTMLNames::customContentStringAttrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjTypedArrayAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.typedArrayAttr())); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjAttrWithGetterException(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ExceptionCode ec = 0; |
| TestObj& impl = castedThis->impl(); |
| JSC::JSValue result = jsNumber(impl.attrWithGetterException(ec)); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjAttrWithSetterException(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.attrWithSetterException()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjStringAttrWithGetterException(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ExceptionCode ec = 0; |
| TestObj& impl = castedThis->impl(); |
| JSC::JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec)); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjStringAttrWithSetterException(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.stringAttrWithSetterException()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjCustomAttr(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| return JSValue::encode(castedThis->customAttr(exec)); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptStateAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.withScriptStateAttribute(exec)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttribute(scriptContext))); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ExceptionCode ec = 0; |
| TestObj& impl = castedThis->impl(); |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptStateAttributeRaises(exec, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ExceptionCode ec = 0; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| TestObj& impl = castedThis->impl(); |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(scriptContext, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext))); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ExceptionCode ec = 0; |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| TestObj& impl = castedThis->impl(); |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!scriptContext) |
| return JSValue::encode(jsUndefined()); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext))); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptArgumentsAndCallStackAttribute())); |
| return JSValue::encode(result); |
| } |
| |
| |
| #if ENABLE(Condition1) |
| EncodedJSValue jsTestObjConditionalAttr1(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.conditionalAttr1()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| EncodedJSValue jsTestObjConditionalAttr2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.conditionalAttr2()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| EncodedJSValue jsTestObjConditionalAttr3(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.conditionalAttr3()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) |
| EncodedJSValue jsTestObjConditionalAttr4Constructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| return JSValue::encode(JSTestObjectA::getConstructor(exec->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| EncodedJSValue jsTestObjConditionalAttr5Constructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| return JSValue::encode(JSTestObjectB::getConstructor(exec->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| EncodedJSValue jsTestObjConditionalAttr6Constructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| return JSValue::encode(JSTestObjectC::getConstructor(exec->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| EncodedJSValue jsTestObjCachedAttribute1(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| if (JSValue cachedValue = castedThis->m_cachedAttribute1.get()) |
| return JSValue::encode(cachedValue); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = (impl.cachedAttribute1().hasNoValue() ? jsNull() : impl.cachedAttribute1().jsValue()); |
| castedThis->m_cachedAttribute1.set(exec->vm(), castedThis, result); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjCachedAttribute2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| if (JSValue cachedValue = castedThis->m_cachedAttribute2.get()) |
| return JSValue::encode(cachedValue); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = (impl.cachedAttribute2().hasNoValue() ? jsNull() : impl.cachedAttribute2().jsValue()); |
| castedThis->m_cachedAttribute2.set(exec->vm(), castedThis, result); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjAnyAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = (impl.anyAttribute().hasNoValue() ? jsNull() : impl.anyAttribute().jsValue()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjContentDocument(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| TestObj& impl = castedThis->impl(); |
| return JSValue::encode(shouldAllowAccessToNode(exec, impl.contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.contentDocument())) : jsNull()); |
| } |
| |
| |
| EncodedJSValue jsTestObjMutablePoint(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint))); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjImmutablePoint(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint()))); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjStrawberry(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.blueberry()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjStrictFloat(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.strictFloat()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjDescription(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.description()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjId(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.id()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjHash(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.hash()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjReplaceableAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.replaceableAttribute()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjNullableDoubleAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.nullableDoubleAttribute(isNull)); |
| if (isNull) |
| return JSValue::encode(jsNull()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjNullableLongAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.nullableLongAttribute(isNull)); |
| if (isNull) |
| return JSValue::encode(jsNull()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjNullableBooleanAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsBoolean(impl.nullableBooleanAttribute(isNull)); |
| if (isNull) |
| return JSValue::encode(jsNull()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjNullableStringAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.nullableStringAttribute(isNull)); |
| if (isNull) |
| return JSValue::encode(jsNull()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjNullableLongSettableAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| bool isNull = false; |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsNumber(impl.nullableLongSettableAttribute(isNull)); |
| if (isNull) |
| return JSValue::encode(jsNull()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjNullableStringValue(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ExceptionCode ec = 0; |
| bool isNull = false; |
| TestObj& impl = castedThis->impl(); |
| JSC::JSValue result = jsNumber(impl.nullableStringValue(isNull, ec)); |
| if (isNull) |
| return JSValue::encode(jsNull()); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjAttribute(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.attribute()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjAttributeWithReservedEnumType(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| UNUSED_PARAM(slotBase); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| UNUSED_PARAM(exec); |
| TestObj& impl = castedThis->impl(); |
| JSValue result = jsStringWithCache(exec, impl.attributeWithReservedEnumType()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsTestObjConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName) |
| { |
| JSTestObj* domObject = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!domObject) |
| return throwVMTypeError(exec); |
| if (!domObject) |
| return throwVMTypeError(exec); |
| return JSValue::encode(JSTestObj::getConstructor(exec->vm(), domObject->globalObject())); |
| } |
| |
| void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| // Shadowing a built-in constructor |
| castedThis->putDirect(exec->vm(), Identifier(exec, "TestSubObjEnabledBySetting"), value); |
| } |
| |
| |
| void setJSTestObjEnumAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int8_t nativeValue(toInt8(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setByteAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjOctetAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| uint8_t nativeValue(toUInt8(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setOctetAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjShortAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int16_t nativeValue(toInt16(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setShortAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| uint16_t nativeValue(toUInt16(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setUnsignedShortAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjLongAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setLongAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjLongLongAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| long long nativeValue(toInt64(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setLongLongAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| unsigned long long nativeValue(toUInt64(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setUnsignedLongLongAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl.setTestObjAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl.setXMLObjAttr(nativeValue); |
| } |
| |
| |
| void setJSTestObjCreate(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| bool nativeValue(value.toBoolean(exec)); |
| if (exec->hadException()) |
| return; |
| impl.setCreate(nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl.setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| unsigned nativeValue(toUInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| bool nativeValue(value.toBoolean(exec)); |
| if (exec->hadException()) |
| return; |
| impl.setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl.setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl.setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| bool nativeValue(value.toBoolean(exec)); |
| if (exec->hadException()) |
| return; |
| impl.setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| const String& nativeValue(valueToStringWithNullCheck(exec, value)); |
| if (exec->hadException()) |
| return; |
| impl.setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue); |
| } |
| |
| |
| void setJSTestObjTypedArrayAttr(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| RefPtr<Float32Array> nativeValue(toFloat32Array(value)); |
| if (exec->hadException()) |
| return; |
| impl.setTypedArrayAttr(nativeValue.get()); |
| } |
| |
| |
| void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setAttrWithGetterException(nativeValue); |
| } |
| |
| |
| void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| castedThis->setCustomAttr(exec, value); |
| } |
| |
| |
| void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setWithScriptStateAttribute(exec, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl.setWithScriptStateAttributeRaises(exec, nativeValue); |
| } |
| |
| |
| void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| TestObj* nativeValue(toTestObj(value)); |
| if (exec->hadException()) |
| return; |
| impl.setWithScriptArgumentsAndCallStackAttribute(nativeValue); |
| } |
| |
| |
| #if ENABLE(Condition1) |
| void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = 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* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setConditionalAttr3(nativeValue); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) |
| void setJSTestObjConditionalAttr4Constructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| // Shadowing a built-in constructor |
| castedThis->putDirect(exec->vm(), Identifier(exec, "conditionalAttr4"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) && ENABLE(Condition2) |
| void setJSTestObjConditionalAttr5Constructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| // Shadowing a built-in constructor |
| castedThis->putDirect(exec->vm(), Identifier(exec, "conditionalAttr5"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| // Shadowing a built-in constructor |
| castedThis->putDirect(exec->vm(), Identifier(exec, "conditionalAttr6"), value); |
| } |
| |
| #endif |
| |
| void setJSTestObjAnyAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| Deprecated::ScriptValue nativeValue(exec->vm(), value); |
| if (exec->hadException()) |
| return; |
| impl.setAnyAttribute(nativeValue); |
| } |
| |
| |
| void setJSTestObjMutablePoint(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| SVGPropertyTearOff<SVGPoint>* nativeValue(toSVGPoint(value)); |
| if (exec->hadException()) |
| return; |
| impl.setMutablePoint(nativeValue); |
| } |
| |
| |
| void setJSTestObjImmutablePoint(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| SVGPropertyTearOff<SVGPoint>* nativeValue(toSVGPoint(value)); |
| if (exec->hadException()) |
| return; |
| impl.setImmutablePoint(nativeValue); |
| } |
| |
| |
| void setJSTestObjStrawberry(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setBlueberry(nativeValue); |
| } |
| |
| |
| void setJSTestObjStrictFloat(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| float nativeValue(value.toFloat(exec)); |
| if (exec->hadException()) |
| return; |
| impl.setStrictFloat(nativeValue); |
| } |
| |
| |
| void setJSTestObjId(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setId(nativeValue); |
| } |
| |
| |
| void setJSTestObjReplaceableAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| // Shadowing a built-in object |
| castedThis->putDirect(exec->vm(), Identifier(exec, "replaceableAttribute"), value); |
| } |
| |
| |
| void setJSTestObjNullableLongSettableAttribute(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setNullableLongSettableAttribute(nativeValue); |
| } |
| |
| |
| void setJSTestObjNullableStringValue(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| int nativeValue(toInt32(exec, value, NormalConversion)); |
| if (exec->hadException()) |
| return; |
| impl.setNullableStringValue(nativeValue); |
| } |
| |
| |
| void setJSTestObjAttributeWithReservedEnumType(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(exec); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); |
| if (!castedThis) { |
| throwVMTypeError(exec); |
| return; |
| } |
| TestObj& impl = castedThis->impl(); |
| const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); |
| if (exec->hadException()) |
| return; |
| if (nativeValue != "" && nativeValue != "OptionalValue1" && nativeValue != "OptionalValue2" && nativeValue != "OptionalValue3") |
| return; |
| impl.setAttributeWithReservedEnumType(nativeValue); |
| } |
| |
| |
| JSValue JSTestObj::getConstructor(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSTestObjConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| impl.voidMethod(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| |
| JSC::JSValue result = jsNumber(impl.byteMethod()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionByteMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| |
| JSC::JSValue result = jsNumber(impl.octetMethod()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOctetMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| |
| JSC::JSValue result = jsNumber(impl.longMethod()); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| return JSValue::encode(castedThis->customMethod(exec)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| return JSValue::encode(castedThis->customMethodWithArgs(exec)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| impl.withScriptStateVoid(exec); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| if (!exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject()); |
| impl.methodWithCallbackArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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->argument(1).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->uncheckedArgument(1)), castedThis->globalObject()); |
| impl.methodWithNonCallbackArgAndCallbackArg(nonCallback, callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| RefPtr<TestCallback> callback; |
| if (!exec->argument(0).isUndefinedOrNull()) { |
| if (!exec->uncheckedArgument(0).isFunction()) |
| return throwVMTypeError(exec); |
| callback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject()); |
| } |
| impl.methodWithCallbackAndOptionalArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg(ExecState* exec) |
| { |
| RefPtr<TestCallback> callback; |
| if (!exec->argument(0).isUndefinedOrNull()) { |
| if (!exec->uncheckedArgument(0).isFunction()) |
| return throwVMTypeError(exec); |
| callback = createFunctionOnlyCallback<JSTestCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument(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->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = createFunctionOnlyCallback<JSTestCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->uncheckedArgument(0)); |
| TestObj::staticMethodWithCallbackArg(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #if ENABLE(Condition1) |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalMethod1(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| impl.conditionalMethod3(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| if (exec->argumentCount() < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| if (!exec->argument(0).isFunction()) |
| return throwVMTypeError(exec); |
| RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject()); |
| impl.overloadedMethod(callback); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod6(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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 arg0(exec->argument(0)); |
| JSValue arg1(exec->argument(1)); |
| if ((argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info()))) && (arg1.isUndefinedOrNull() || arg1.isString() || arg1.isObject()))) |
| return jsTestObjPrototypeFunctionOverloadedMethod1(exec); |
| if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::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::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::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()); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecState* exec) |
| { |
| size_t argsCount = exec->argumentCount(); |
| #if ENABLE(Condition1) |
| if (argsCount == 1) |
| return jsTestObjConstructorFunctionOverloadedMethod11(exec); |
| #endif |
| |
| JSValue arg0(exec->argument(0)); |
| #if ENABLE(Condition1) |
| if ((argsCount == 1 && (arg0.isUndefinedOrNull() || arg0.isString() || arg0.isObject()))) |
| return jsTestObjConstructorFunctionOverloadedMethod12(exec); |
| #endif |
| |
| if (argsCount < 1) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| return throwVMTypeError(exec); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithClamp(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| impl.banana(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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 jsTestObjPrototypeFunctionStrictFunctionWithSequence(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| ExceptionCode ec = 0; |
| if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(JSTestObj::info())) |
| return throwVMTypeError(exec); |
| TestObj* objArg(toTestObj(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| Vector<unsigned> a(toNativeArray<unsigned>(exec, exec->argument(1))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.strictFunctionWithSequence(objArg, a, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunctionWithArray(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| ExceptionCode ec = 0; |
| if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(JSTestObj::info())) |
| return throwVMTypeError(exec); |
| TestObj* objArg(toTestObj(exec->argument(0))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| Vector<int> array(toNativeArray<int>(exec, exec->argument(1))); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| |
| JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.strictFunctionWithArray(objArg, array, ec))); |
| setDOMException(exec, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicStringMethod(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = 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, count = exec->argumentCount(); i < count; ++i) { |
| if (!exec->uncheckedArgument(i).inherits(JSNode::info())) |
| return throwVMTypeError(exec); |
| tail.append(toNode(exec->uncheckedArgument(i))); |
| } |
| impl.variadicNodeMethod(head, tail); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(ExecState* exec) |
| { |
| JSValue thisValue = exec->hostThisValue(); |
| JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue); |
| if (!castedThis) |
| return throwVMTypeError(exec); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info()); |
| TestObj& impl = castedThis->impl(); |
| if (exec->argumentCount() < 2) |
| return throwVMError(exec, createNotEnoughArgumentsError(exec)); |
| float a(exec->argument(0).toFloat(exec)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| int b(toInt32(exec, exec->argument(1), NormalConversion)); |
| if (exec->hadException()) |
| return JSValue::encode(jsUndefined()); |
| impl.any(a, b); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor) |
| { |
| JSTestObj* thisObject = jsCast<JSTestObj*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, 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) |
| EncodedJSValue jsTestObjCONDITIONAL_CONST(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0))); |
| } |
| |
| #endif |
| EncodedJSValue jsTestObjCONST_VALUE_0(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_1(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(1))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_2(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(2))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_4(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(4))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_8(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(8))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_9(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(-1))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_10(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| return JSValue::encode(jsStringOrNull(exec, String("my constant string"))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_11(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0xffffffff))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_12(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0x01))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_13(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0X20))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_VALUE_14(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0x1abc))); |
| } |
| |
| EncodedJSValue jsTestObjCONST_JAVASCRIPT(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(15))); |
| } |
| |
| EncodedJSValue jsTestObjReadonly(ExecState* exec, EncodedJSValue, EncodedJSValue, PropertyName) |
| { |
| UNUSED_PARAM(exec); |
| return JSValue::encode(jsNumber(static_cast<int>(0))); |
| } |
| |
| bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| UNUSED_PARAM(handle); |
| 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::info()) ? &jsCast<JSTestObj*>(value)->impl() : 0; |
| } |
| |
| } |