Changeset 206953 in webkit
- Timestamp:
- Oct 8, 2016 6:09:30 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206952 r206953 1 2016-10-08 Youenn Fablet <youenn@apple.com> 2 3 Refactor binding generated casted-this checks 4 https://bugs.webkit.org/show_bug.cgi?id=162677 5 6 Reviewed by Darin Adler. 7 8 No change of behavior. 9 10 Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks. 11 12 The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue. 13 In the future, the second function should only take references. 14 15 Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value. 16 This allows implementing the first function using the second function as template parameter. 17 18 Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access. 19 20 * bindings/js/JSDOMBinding.h: 21 (WebCore::BindingCaller::attribute): 22 * bindings/scripts/CodeGeneratorJS.pm: 23 (GenerateHeader): 24 (GenerateImplementation): 25 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: 26 * bindings/scripts/test/JS/JSTestActiveDOMObject.h: 27 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 28 * bindings/scripts/test/JS/JSTestEventConstructor.h: 29 * bindings/scripts/test/JS/JSTestException.cpp: 30 * bindings/scripts/test/JS/JSTestException.h: 31 * bindings/scripts/test/JS/JSTestGlobalObject.cpp: 32 * bindings/scripts/test/JS/JSTestInterface.cpp: 33 * bindings/scripts/test/JS/JSTestInterface.h: 34 * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: 35 * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h: 36 * bindings/scripts/test/JS/JSTestNode.cpp: 37 * bindings/scripts/test/JS/JSTestNode.h: 38 * bindings/scripts/test/JS/JSTestNondeterministic.cpp: 39 * bindings/scripts/test/JS/JSTestNondeterministic.h: 40 * bindings/scripts/test/JS/JSTestObj.cpp: 41 * bindings/scripts/test/JS/JSTestObj.h: 42 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 43 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: 44 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 45 * bindings/scripts/test/JS/JSTestTypedefs.h: 46 * bindings/scripts/test/JS/JSattribute.cpp: 47 * bindings/scripts/test/JS/JSattribute.h: 48 1 49 2016-10-08 Enrique Ocaña González <eocanha@igalia.com> 2 50 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r206681 r206953 383 383 template<typename VariadicHelper> typename VariadicHelper::Result toArguments(JSC::ExecState&, size_t startIndex = 0); 384 384 385 enum class CastedThisErrorBehavior { Throw, ReturnEarly }; 386 387 template<typename JSClass> 388 struct BindingCaller { 389 using AttributeGetterFunction = JSC::JSValue(JSC::ExecState*, JSClass*, JSC::ThrowScope&); 390 391 template<AttributeGetterFunction getter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw> 392 static JSC::EncodedJSValue attribute(JSC::ExecState* state, JSC::EncodedJSValue thisValue, const char* attributeName) 393 { 394 ASSERT(state); 395 auto throwScope = DECLARE_THROW_SCOPE(state->vm()); 396 auto* thisObject = JSClass::castForAttribute(state, thisValue); 397 if (UNLIKELY(!thisObject)) { 398 ASSERT(JSClass::info()); 399 return shouldThrow == CastedThisErrorBehavior::Throw ? 400 throwGetterTypeError(*state, throwScope, JSClass::info()->className, attributeName) : JSC::JSValue::encode(JSC::jsUndefined()); 401 } 402 // FIXME: We should refactor the binding generated code to use references for state and thisObject. 403 return JSC::JSValue::encode(getter(state, thisObject, throwScope)); 404 } 405 }; 406 385 407 // Inline functions and template definitions. 386 408 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r206877 r206953 1411 1411 # Attribute and function enums 1412 1412 if ($numAttributes > 0) { 1413 push(@headerContent, " static ${className}* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);\n"); 1414 1413 1415 foreach (@{$interface->attributes}) { 1414 1416 my $attribute = $_; … … 2404 2406 2405 2407 push(@implContent, $endAppleCopyright) if $inAppleCopyright; 2406 2407 2408 push(@implContent, "\n"); 2408 2409 } … … 2410 2411 if ($numAttributes > 0 || NeedsConstructorProperty($interface)) { 2411 2412 push(@implContent, "// Attributes\n\n"); 2413 2412 2414 foreach my $attribute (@{$interface->attributes}) { 2413 2415 next if $attribute->signature->extendedAttributes->{ForwardDeclareInHeader}; … … 2858 2860 2859 2861 } 2862 2863 if ($numAttributes > 0) { 2864 my $castingFunction = $interface->extendedAttributes->{"CustomProxyToJSObject"} ? "to${className}" : GetCastingHelperForThisObject($interface); 2865 # FIXME: Remove ImplicitThis keyword as it is no longer defined by WebIDL spec and is only used in DOMWindow. 2866 if ($interface->extendedAttributes->{"ImplicitThis"}) { 2867 push(@implContent, "inline ${className}* ${className}::castForAttribute(ExecState* state, EncodedJSValue thisValue)\n"); 2868 push(@implContent, "{\n"); 2869 push(@implContent, " JSValue decodedThisValue = JSValue::decode(thisValue);\n"); 2870 push(@implContent, " if (decodedThisValue.isUndefinedOrNull())\n"); 2871 push(@implContent, " decodedThisValue = state->thisValue().toThis(state, NotStrictMode);\n"); 2872 push(@implContent, " return $castingFunction(decodedThisValue);\n"); 2873 push(@implContent, "}\n\n"); 2874 } else { 2875 push(@implContent, "inline ${className}* ${className}::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)\n"); 2876 push(@implContent, "{\n"); 2877 push(@implContent, " return $castingFunction(JSValue::decode(thisValue));\n"); 2878 push(@implContent, "}\n\n"); 2879 } 2880 } 2881 2860 2882 $numAttributes = $numAttributes + 1 if NeedsConstructorProperty($interface); 2861 2883 if ($numAttributes > 0) { … … 2875 2897 push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString; 2876 2898 2877 push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName)\n");2878 push(@implContent, "{\n");2879 2880 push(@implContent, " VM& vm = state->vm();\n");2881 push(@implContent, " auto throwScope = DECLARE_THROW_SCOPE(vm);\n");2882 push(@implContent, " UNUSED_PARAM(throwScope);\n");2883 push(@implContent, " UNUSED_PARAM(thisValue);\n");2884 2885 2899 if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) { 2886 push(@implContent, " JSValue decodedThisValue = JSValue::decode(thisValue);\n"); 2887 my $castingFunction = $interface->extendedAttributes->{CustomProxyToJSObject} ? "to${className}" : GetCastingHelperForThisObject($interface); 2888 # http://heycam.github.io/webidl/#ImplicitThis 2889 if ($interface->extendedAttributes->{ImplicitThis}) { 2890 push(@implContent, " auto* castedThis = decodedThisValue.isUndefinedOrNull() ? $castingFunction(state->thisValue().toThis(state, NotStrictMode)) : $castingFunction(decodedThisValue);\n"); 2891 } else { 2892 push(@implContent, " auto* castedThis = $castingFunction(decodedThisValue);\n"); 2893 } 2894 push(@implContent, " if (UNLIKELY(!castedThis)) {\n"); 2895 if ($attribute->signature->extendedAttributes->{LenientThis}) { 2896 push(@implContent, " return JSValue::encode(jsUndefined());\n"); 2897 } else { 2898 push(@implContent, " return throwGetterTypeError(*state, throwScope, \"$visibleInterfaceName\", \"$name\");\n"); 2899 } 2900 push(@implContent, " }\n"); 2901 } 2900 my $templateParameters = "${getFunctionName}Getter"; 2901 $templateParameters .= ", CastedThisErrorBehavior::ReturnEarly" if ($attribute->signature->extendedAttributes->{LenientThis}); 2902 push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState*, ${className}*, ThrowScope& throwScope);\n\n"); 2903 2904 push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName)\n"); 2905 push(@implContent, "{\n"); 2906 push(@implContent, " return BindingCaller<${className}>::attribute<${templateParameters}>(state, thisValue, \"$name\");\n"); 2907 push(@implContent, "}\n\n"); 2908 2909 push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState* state, ${className}* thisObject, ThrowScope& throwScope)\n"); 2910 push(@implContent, "{\n"); 2911 push(@implContent, " UNUSED_PARAM(throwScope);\n"); 2912 } else { 2913 push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState*);\n\n"); 2914 2915 push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue, PropertyName)\n"); 2916 push(@implContent, "{\n"); 2917 push(@implContent, " return JSValue::encode(${getFunctionName}Getter(state));\n"); 2918 push(@implContent, "}\n\n"); 2919 2920 push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState* state)\n"); 2921 push(@implContent, "{\n"); 2922 } 2923 push(@implContent, " UNUSED_PARAM(state);\n"); 2902 2924 2903 2925 my @arguments = (); … … 2917 2939 AddToImplIncludes("Settings.h"); 2918 2940 my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{EnabledBySetting}) . "Enabled"; 2919 push(@implContent, " if (UNLIKELY(! castedThis->wrapped().frame()))\n");2920 push(@implContent, " return JSValue::encode(jsUndefined());\n");2921 push(@implContent, " Settings& settings = castedThis->wrapped().frame()->settings();\n");2941 push(@implContent, " if (UNLIKELY(!thisObject->wrapped().frame()))\n"); 2942 push(@implContent, " return jsUndefined();\n"); 2943 push(@implContent, " Settings& settings = thisObject->wrapped().frame()->settings();\n"); 2922 2944 push(@implContent, " if (!settings.$enable_function())\n"); 2923 push(@implContent, " return JSValue::encode(jsUndefined());\n");2945 push(@implContent, " return jsUndefined();\n"); 2924 2946 } 2925 2947 } … … 2931 2953 !$attribute->signature->extendedAttributes->{DoNotCheckSecurityOnGetter}) { 2932 2954 if ($interfaceName eq "DOMWindow") { 2933 push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis->wrapped(), ThrowSecurityError))\n");2955 push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, thisObject->wrapped(), ThrowSecurityError))\n"); 2934 2956 } else { 2935 push(@implContent, " if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis->wrapped().frame(), ThrowSecurityError))\n");2957 push(@implContent, " if (!BindingSecurity::shouldAllowAccessToFrame(state, thisObject->wrapped().frame(), ThrowSecurityError))\n"); 2936 2958 } 2937 push(@implContent, " return JSValue::encode(jsUndefined());\n");2959 push(@implContent, " return jsUndefined();\n"); 2938 2960 } 2939 2961 … … 2952 2974 push(@implContent, " static NeverDestroyed<const AtomicString> bindingName(\"$interfaceName.$name\", AtomicString::ConstructFromLiteral);\n"); 2953 2975 push(@implContent, " if (cursor.isCapturing()) {\n"); 2954 push(@implContent, " $memoizedType memoizedResult = castedThis->wrapped().$implGetterFunctionName(" . join(", ", @arguments) . ");\n");2976 push(@implContent, " $memoizedType memoizedResult = thisObject->wrapped().$implGetterFunctionName(" . join(", ", @arguments) . ");\n"); 2955 2977 push(@implContent, " cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName.get().string(), memoizedResult, $exceptionCode);\n"); 2956 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", " castedThis") . ";\n");2978 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", "thisObject") . ";\n"); 2957 2979 push(@implContent, " setDOMException(state, throwScope, ec);\n") if $getterMayThrowLegacyException; 2958 push(@implContent, " return JSValue::encode(result);\n");2980 push(@implContent, " return result;\n"); 2959 2981 push(@implContent, " }\n"); 2960 2982 push(@implContent, "\n"); … … 2964 2986 push(@implContent, " if (input && input->convertTo<$memoizedType>(memoizedResult)) {\n"); 2965 2987 # FIXME: the generated code should report an error if an input cannot be fetched or converted. 2966 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", " castedThis") . ";\n");2988 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", "thisObject") . ";\n"); 2967 2989 push(@implContent, " setDOMException(state, throwScope, input->exceptionCode());\n") if $getterMayThrowLegacyException; 2968 push(@implContent, " return JSValue::encode(result);\n");2990 push(@implContent, " return result;\n"); 2969 2991 push(@implContent, " }\n"); 2970 2992 push(@implContent, " }\n"); … … 2973 2995 2974 2996 if (HasCustomGetter($attribute->signature->extendedAttributes)) { 2975 push(@implContent, " return JSValue::encode(castedThis->$implGetterFunctionName(*state));\n");2997 push(@implContent, " return thisObject->$implGetterFunctionName(*state);\n"); 2976 2998 } elsif ($attribute->signature->extendedAttributes->{CheckSecurityForNode}) { 2977 2999 $implIncludes{"JSDOMBinding.h"} = 1; 2978 push(@implContent, " auto& impl = castedThis->wrapped();\n");2979 push(@implContent, " return JSValue::encode(shouldAllowAccessToNode(state, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull());\n");3000 push(@implContent, " auto& impl = thisObject->wrapped();\n"); 3001 push(@implContent, " return shouldAllowAccessToNode(state, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName()", "thisObject") . " : jsNull();\n"); 2980 3002 } elsif ($type eq "EventHandler") { 2981 3003 $implIncludes{"EventNames.h"} = 1; … … 2984 3006 : "eventHandlerAttribute"; 2985 3007 my $eventName = EventHandlerAttributeEventName($attribute); 2986 push(@implContent, " UNUSED_PARAM(state);\n"); 2987 push(@implContent, " return JSValue::encode($getter(castedThis->wrapped(), $eventName));\n"); 3008 push(@implContent, " return $getter(thisObject->wrapped(), $eventName);\n"); 2988 3009 } elsif ($attribute->signature->type =~ /Constructor$/) { 2989 3010 my $constructorType = $attribute->signature->type; 2990 3011 $constructorType =~ s/Constructor$//; 2991 # When Constructor attribute is used by DOMWindow.idl, it's correct to pass castedThisas the global object2992 # When JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()3012 # When Constructor attribute is used by DOMWindow.idl, it's correct to pass thisObject as the global object 3013 # When JSDOMWrappers have a back-pointer to the globalObject we can pass thisObject->globalObject() 2993 3014 if ($interfaceName eq "DOMWindow") { 2994 3015 my $named = ($constructorType =~ /Named$/) ? "Named" : ""; 2995 3016 $constructorType =~ s/Named$//; 2996 push(@implContent, " return JS Value::encode(JS" . $constructorType . "::get${named}Constructor(state->vm(), castedThis));\n");3017 push(@implContent, " return JS" . $constructorType . "::get${named}Constructor(state->vm(), thisObject);\n"); 2997 3018 } else { 2998 3019 AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{Conditional}); 2999 push(@implContent, " return JS Value::encode(JS" . $constructorType . "::getConstructor(state->vm(), castedThis->globalObject()));\n");3020 push(@implContent, " return JS" . $constructorType . "::getConstructor(state->vm(), thisObject->globalObject());\n"); 3000 3021 } 3001 3022 } elsif (!$attribute->signature->extendedAttributes->{GetterMayThrowLegacyException} && !$attribute->signature->extendedAttributes->{GetterMayThrowLegacyExceptionWithMessage}) { … … 3004 3025 $cacheIndex = $currentCachedAttribute; 3005 3026 $currentCachedAttribute++; 3006 push(@implContent, " if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");3007 push(@implContent, " return JSValue::encode(cachedValue);\n");3027 push(@implContent, " if (JSValue cachedValue = thisObject->m_" . $attribute->signature->name . ".get())\n"); 3028 push(@implContent, " return cachedValue;\n"); 3008 3029 } 3009 3030 3010 my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, " JSValue::encode(jsUndefined())");3031 my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "jsUndefined()"); 3011 3032 3012 3033 if ($svgListPropertyType) { 3013 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, " castedThis->wrapped().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");3034 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "thisObject->wrapped().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "thisObject") . ";\n"); 3014 3035 } elsif ($svgPropertyOrListPropertyType) { 3015 push(@implContent, " $svgPropertyOrListPropertyType& impl = castedThis->wrapped().propertyReference();\n");3036 push(@implContent, " $svgPropertyOrListPropertyType& impl = thisObject->wrapped().propertyReference();\n"); 3016 3037 if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber 3017 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl", " castedThis") . ";\n");3038 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl", "thisObject") . ";\n"); 3018 3039 } else { 3019 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", " castedThis") . ";\n");3040 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "thisObject") . ";\n"); 3020 3041 3021 3042 } … … 3034 3055 3035 3056 unshift(@arguments, @callWithArgs); 3036 my $jsType = NativeToJSValue($attribute->signature, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", " castedThis");3037 push(@implContent, " auto& impl = castedThis->wrapped();\n") if !$attribute->isStatic;3057 my $jsType = NativeToJSValue($attribute->signature, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", "thisObject"); 3058 push(@implContent, " auto& impl = thisObject->wrapped();\n") if !$attribute->isStatic; 3038 3059 if ($codeGenerator->IsSVGAnimatedType($type)) { 3039 3060 push(@implContent, " auto obj = $jsType;\n"); 3040 push(@implContent, " JSValue result = toJS(state, castedThis->globalObject(), obj.get());\n");3061 push(@implContent, " JSValue result = toJS(state, thisObject->globalObject(), obj.get());\n"); 3041 3062 } else { 3042 3063 push(@implContent, " JSValue result = $jsType;\n"); … … 3044 3065 } 3045 3066 3046 push(@implContent, " castedThis->m_" . $attribute->signature->name . ".set(state->vm(), castedThis, result);\n") if $attribute->signature->extendedAttributes->{CachedAttribute};3047 push(@implContent, " return JSValue::encode(result);\n");3067 push(@implContent, " thisObject->m_" . $attribute->signature->name . ".set(state->vm(), thisObject, result);\n") if $attribute->signature->extendedAttributes->{CachedAttribute}; 3068 push(@implContent, " return result;\n"); 3048 3069 3049 3070 } else { 3050 unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, " JSValue::encode(jsUndefined())"));3071 unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "jsUndefined()")); 3051 3072 3052 3073 if ($svgPropertyOrListPropertyType) { 3053 push(@implContent, " $svgPropertyOrListPropertyType impl(* castedThis->wrapped());\n");3054 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", " castedThis") . ";\n");3074 push(@implContent, " $svgPropertyOrListPropertyType impl(*thisObject->wrapped());\n"); 3075 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "thisObject") . ";\n"); 3055 3076 } else { 3056 push(@implContent, " auto& impl = castedThis->wrapped();\n");3057 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", " castedThis") . ";\n");3077 push(@implContent, " auto& impl = thisObject->wrapped();\n"); 3078 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "thisObject") . ";\n"); 3058 3079 } 3059 3080 3060 3081 push(@implContent, " setDOMException(state, throwScope, ec);\n"); 3061 3082 3062 push(@implContent, " return JSValue::encode(result);\n");3083 push(@implContent, " return result;\n"); 3063 3084 } 3064 3085 3065 3086 push(@implContent, "}\n\n"); 3066 3087 3067 push(@implContent, "#endif\n") if $attributeConditionalString; 3068 3069 push(@implContent, "\n"); 3088 push(@implContent, "#endif\n\n") if $attributeConditionalString; 3070 3089 } 3071 3090 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
r206723 r206953 141 141 } 142 142 143 inline JSTestActiveDOMObject* JSTestActiveDOMObject::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 144 { 145 return jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); 146 } 147 148 static inline JSValue jsTestActiveDOMObjectExcitingAttrGetter(ExecState*, JSTestActiveDOMObject*, ThrowScope& throwScope); 149 143 150 EncodedJSValue jsTestActiveDOMObjectExcitingAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 144 151 { 145 VM& vm = state->vm(); 146 auto throwScope = DECLARE_THROW_SCOPE(vm); 152 return BindingCaller<JSTestActiveDOMObject>::attribute<jsTestActiveDOMObjectExcitingAttrGetter>(state, thisValue, "excitingAttr"); 153 } 154 155 static inline JSValue jsTestActiveDOMObjectExcitingAttrGetter(ExecState* state, JSTestActiveDOMObject* thisObject, ThrowScope& throwScope) 156 { 147 157 UNUSED_PARAM(throwScope); 148 UNUSED_PARAM(thisValue); 149 JSValue decodedThisValue = JSValue::decode(thisValue); 150 auto* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(decodedThisValue); 151 if (UNLIKELY(!castedThis)) { 152 return throwGetterTypeError(*state, throwScope, "TestActiveDOMObject", "excitingAttr"); 153 } 154 if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis->wrapped().frame(), ThrowSecurityError)) 155 return JSValue::encode(jsUndefined()); 156 auto& impl = castedThis->wrapped(); 158 UNUSED_PARAM(state); 159 if (!BindingSecurity::shouldAllowAccessToFrame(state, thisObject->wrapped().frame(), ThrowSecurityError)) 160 return jsUndefined(); 161 auto& impl = thisObject->wrapped(); 157 162 JSValue result = jsNumber(impl.excitingAttr()); 158 return JSValue::encode(result); 159 } 160 163 return result; 164 } 161 165 162 166 EncodedJSValue jsTestActiveDOMObjectConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
r206723 r206953 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static JSTestActiveDOMObject* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 52 53 public: 53 54 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
r206723 r206953 179 179 } 180 180 181 inline JSTestEventConstructor* JSTestEventConstructor::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 182 { 183 return jsDynamicCast<JSTestEventConstructor*>(JSValue::decode(thisValue)); 184 } 185 186 static inline JSValue jsTestEventConstructorAttr1Getter(ExecState*, JSTestEventConstructor*, ThrowScope& throwScope); 187 181 188 EncodedJSValue jsTestEventConstructorAttr1(ExecState* state, EncodedJSValue thisValue, PropertyName) 182 189 { 183 VM& vm = state->vm(); 184 auto throwScope = DECLARE_THROW_SCOPE(vm); 190 return BindingCaller<JSTestEventConstructor>::attribute<jsTestEventConstructorAttr1Getter>(state, thisValue, "attr1"); 191 } 192 193 static inline JSValue jsTestEventConstructorAttr1Getter(ExecState* state, JSTestEventConstructor* thisObject, ThrowScope& throwScope) 194 { 185 195 UNUSED_PARAM(throwScope); 186 UNUSED_PARAM(thisValue); 187 JSValue decodedThisValue = JSValue::decode(thisValue); 188 auto* castedThis = jsDynamicCast<JSTestEventConstructor*>(decodedThisValue); 189 if (UNLIKELY(!castedThis)) { 190 return throwGetterTypeError(*state, throwScope, "TestEventConstructor", "attr1"); 191 } 192 auto& impl = castedThis->wrapped(); 196 UNUSED_PARAM(state); 197 auto& impl = thisObject->wrapped(); 193 198 JSValue result = jsStringWithCache(state, impl.attr1()); 194 return JSValue::encode(result); 195 } 196 199 return result; 200 } 201 202 static inline JSValue jsTestEventConstructorAttr2Getter(ExecState*, JSTestEventConstructor*, ThrowScope& throwScope); 197 203 198 204 EncodedJSValue jsTestEventConstructorAttr2(ExecState* state, EncodedJSValue thisValue, PropertyName) 199 205 { 200 VM& vm = state->vm(); 201 auto throwScope = DECLARE_THROW_SCOPE(vm); 206 return BindingCaller<JSTestEventConstructor>::attribute<jsTestEventConstructorAttr2Getter>(state, thisValue, "attr2"); 207 } 208 209 static inline JSValue jsTestEventConstructorAttr2Getter(ExecState* state, JSTestEventConstructor* thisObject, ThrowScope& throwScope) 210 { 202 211 UNUSED_PARAM(throwScope); 203 UNUSED_PARAM(thisValue); 204 JSValue decodedThisValue = JSValue::decode(thisValue); 205 auto* castedThis = jsDynamicCast<JSTestEventConstructor*>(decodedThisValue); 206 if (UNLIKELY(!castedThis)) { 207 return throwGetterTypeError(*state, throwScope, "TestEventConstructor", "attr2"); 208 } 209 auto& impl = castedThis->wrapped(); 212 UNUSED_PARAM(state); 213 auto& impl = thisObject->wrapped(); 210 214 JSValue result = jsStringWithCache(state, impl.attr2()); 211 return JSValue::encode(result); 212 } 213 215 return result; 216 } 214 217 215 218 #if ENABLE(SPECIAL_EVENT) 219 static inline JSValue jsTestEventConstructorAttr3Getter(ExecState*, JSTestEventConstructor*, ThrowScope& throwScope); 220 216 221 EncodedJSValue jsTestEventConstructorAttr3(ExecState* state, EncodedJSValue thisValue, PropertyName) 217 222 { 218 VM& vm = state->vm(); 219 auto throwScope = DECLARE_THROW_SCOPE(vm); 223 return BindingCaller<JSTestEventConstructor>::attribute<jsTestEventConstructorAttr3Getter>(state, thisValue, "attr3"); 224 } 225 226 static inline JSValue jsTestEventConstructorAttr3Getter(ExecState* state, JSTestEventConstructor* thisObject, ThrowScope& throwScope) 227 { 220 228 UNUSED_PARAM(throwScope); 221 UNUSED_PARAM(thisValue); 222 JSValue decodedThisValue = JSValue::decode(thisValue); 223 auto* castedThis = jsDynamicCast<JSTestEventConstructor*>(decodedThisValue); 224 if (UNLIKELY(!castedThis)) { 225 return throwGetterTypeError(*state, throwScope, "TestEventConstructor", "attr3"); 226 } 227 auto& impl = castedThis->wrapped(); 229 UNUSED_PARAM(state); 230 auto& impl = thisObject->wrapped(); 228 231 JSValue result = jsStringWithCache(state, impl.attr3()); 229 return JSValue::encode(result);232 return result; 230 233 } 231 234 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
r206723 r206953 52 52 53 53 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 54 static JSTestEventConstructor* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 54 55 protected: 55 56 JSTestEventConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestEventConstructor>&&); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
r206723 r206953 133 133 } 134 134 135 inline JSTestException* JSTestException::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 136 { 137 return jsDynamicCast<JSTestException*>(JSValue::decode(thisValue)); 138 } 139 140 static inline JSValue jsTestExceptionNameGetter(ExecState*, JSTestException*, ThrowScope& throwScope); 141 135 142 EncodedJSValue jsTestExceptionName(ExecState* state, EncodedJSValue thisValue, PropertyName) 136 143 { 137 VM& vm = state->vm(); 138 auto throwScope = DECLARE_THROW_SCOPE(vm); 144 return BindingCaller<JSTestException>::attribute<jsTestExceptionNameGetter>(state, thisValue, "name"); 145 } 146 147 static inline JSValue jsTestExceptionNameGetter(ExecState* state, JSTestException* thisObject, ThrowScope& throwScope) 148 { 139 149 UNUSED_PARAM(throwScope); 140 UNUSED_PARAM(thisValue); 141 JSValue decodedThisValue = JSValue::decode(thisValue); 142 auto* castedThis = jsDynamicCast<JSTestException*>(decodedThisValue); 143 if (UNLIKELY(!castedThis)) { 144 return throwGetterTypeError(*state, throwScope, "TestException", "name"); 145 } 146 auto& impl = castedThis->wrapped(); 150 UNUSED_PARAM(state); 151 auto& impl = thisObject->wrapped(); 147 152 JSValue result = jsStringWithCache(state, impl.name()); 148 return JSValue::encode(result); 149 } 150 153 return result; 154 } 151 155 152 156 EncodedJSValue jsTestExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h
r206723 r206953 51 51 52 52 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 53 static JSTestException* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 53 54 public: 54 55 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
r206723 r206953 178 178 } 179 179 180 inline JSTestGlobalObject* JSTestGlobalObject::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 181 { 182 return jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue)); 183 } 184 185 static inline JSValue jsTestGlobalObjectRegularAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope); 186 180 187 EncodedJSValue jsTestGlobalObjectRegularAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 181 188 { 182 VM& vm = state->vm(); 183 auto throwScope = DECLARE_THROW_SCOPE(vm); 184 UNUSED_PARAM(throwScope); 185 UNUSED_PARAM(thisValue); 186 JSValue decodedThisValue = JSValue::decode(thisValue); 187 auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue); 188 if (UNLIKELY(!castedThis)) { 189 return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "regularAttribute"); 190 } 191 auto& impl = castedThis->wrapped(); 189 return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectRegularAttributeGetter>(state, thisValue, "regularAttribute"); 190 } 191 192 static inline JSValue jsTestGlobalObjectRegularAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope) 193 { 194 UNUSED_PARAM(throwScope); 195 UNUSED_PARAM(state); 196 auto& impl = thisObject->wrapped(); 192 197 JSValue result = jsStringWithCache(state, impl.regularAttribute()); 193 return JSValue::encode(result); 194 } 195 198 return result; 199 } 200 201 static inline JSValue jsTestGlobalObjectPublicAndPrivateAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope); 196 202 197 203 EncodedJSValue jsTestGlobalObjectPublicAndPrivateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 198 204 { 199 VM& vm = state->vm(); 200 auto throwScope = DECLARE_THROW_SCOPE(vm); 201 UNUSED_PARAM(throwScope); 202 UNUSED_PARAM(thisValue); 203 JSValue decodedThisValue = JSValue::decode(thisValue); 204 auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue); 205 if (UNLIKELY(!castedThis)) { 206 return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "publicAndPrivateAttribute"); 207 } 208 auto& impl = castedThis->wrapped(); 205 return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectPublicAndPrivateAttributeGetter>(state, thisValue, "publicAndPrivateAttribute"); 206 } 207 208 static inline JSValue jsTestGlobalObjectPublicAndPrivateAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope) 209 { 210 UNUSED_PARAM(throwScope); 211 UNUSED_PARAM(state); 212 auto& impl = thisObject->wrapped(); 209 213 JSValue result = jsStringWithCache(state, impl.publicAndPrivateAttribute()); 210 return JSValue::encode(result); 211 } 212 213 214 #if ENABLE(TEST_FEATURE) 214 return result; 215 } 216 217 #if ENABLE(TEST_FEATURE) 218 static inline JSValue jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope); 219 215 220 EncodedJSValue jsTestGlobalObjectPublicAndPrivateConditionalAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 216 221 { 217 VM& vm = state->vm(); 218 auto throwScope = DECLARE_THROW_SCOPE(vm); 219 UNUSED_PARAM(throwScope); 220 UNUSED_PARAM(thisValue); 221 JSValue decodedThisValue = JSValue::decode(thisValue); 222 auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue); 223 if (UNLIKELY(!castedThis)) { 224 return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "publicAndPrivateConditionalAttribute"); 225 } 226 auto& impl = castedThis->wrapped(); 222 return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter>(state, thisValue, "publicAndPrivateConditionalAttribute"); 223 } 224 225 static inline JSValue jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope) 226 { 227 UNUSED_PARAM(throwScope); 228 UNUSED_PARAM(state); 229 auto& impl = thisObject->wrapped(); 227 230 JSValue result = jsStringWithCache(state, impl.publicAndPrivateConditionalAttribute()); 228 return JSValue::encode(result); 229 } 230 231 #endif 232 233 #if ENABLE(TEST_FEATURE) 231 return result; 232 } 233 234 #endif 235 236 #if ENABLE(TEST_FEATURE) 237 static inline JSValue jsTestGlobalObjectEnabledAtRuntimeAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope); 238 234 239 EncodedJSValue jsTestGlobalObjectEnabledAtRuntimeAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 235 240 { 236 VM& vm = state->vm(); 237 auto throwScope = DECLARE_THROW_SCOPE(vm); 238 UNUSED_PARAM(throwScope); 239 UNUSED_PARAM(thisValue); 240 JSValue decodedThisValue = JSValue::decode(thisValue); 241 auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue); 242 if (UNLIKELY(!castedThis)) { 243 return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "enabledAtRuntimeAttribute"); 244 } 245 auto& impl = castedThis->wrapped(); 241 return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectEnabledAtRuntimeAttributeGetter>(state, thisValue, "enabledAtRuntimeAttribute"); 242 } 243 244 static inline JSValue jsTestGlobalObjectEnabledAtRuntimeAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope) 245 { 246 UNUSED_PARAM(throwScope); 247 UNUSED_PARAM(state); 248 auto& impl = thisObject->wrapped(); 246 249 JSValue result = jsStringWithCache(state, impl.enabledAtRuntimeAttribute()); 247 return JSValue::encode(result);250 return result; 248 251 } 249 252 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h
r206723 r206953 52 52 53 53 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 54 static JSTestGlobalObject* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 54 55 public: 55 56 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r206723 r206953 411 411 } 412 412 413 #if ENABLE(Condition22) || ENABLE(Condition23) 414 EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 415 { 416 VM& vm = state->vm(); 417 auto throwScope = DECLARE_THROW_SCOPE(vm); 418 UNUSED_PARAM(throwScope); 419 UNUSED_PARAM(thisValue); 413 inline JSTestInterface* JSTestInterface::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 414 { 415 return jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); 416 } 417 418 #if ENABLE(Condition22) || ENABLE(Condition23) 419 static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState*); 420 421 EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue, PropertyName) 422 { 423 return JSValue::encode(jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(state)); 424 } 425 426 static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState* state) 427 { 428 UNUSED_PARAM(state); 420 429 JSValue result = jsNumber(TestInterface::implementsStaticReadOnlyAttr()); 421 return JSValue::encode(result); 422 } 423 424 #endif 425 426 #if ENABLE(Condition22) || ENABLE(Condition23) 427 EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 428 { 429 VM& vm = state->vm(); 430 auto throwScope = DECLARE_THROW_SCOPE(vm); 431 UNUSED_PARAM(throwScope); 432 UNUSED_PARAM(thisValue); 430 return result; 431 } 432 433 #endif 434 435 #if ENABLE(Condition22) || ENABLE(Condition23) 436 static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState*); 437 438 EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue, PropertyName) 439 { 440 return JSValue::encode(jsTestInterfaceConstructorImplementsStaticAttrGetter(state)); 441 } 442 443 static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState* state) 444 { 445 UNUSED_PARAM(state); 433 446 JSValue result = jsStringWithCache(state, TestInterface::implementsStaticAttr()); 434 return JSValue::encode(result); 435 } 436 437 #endif 438 439 #if ENABLE(Condition22) || ENABLE(Condition23) 447 return result; 448 } 449 450 #endif 451 452 #if ENABLE(Condition22) || ENABLE(Condition23) 453 static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 454 440 455 EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* state, EncodedJSValue thisValue, PropertyName) 441 456 { 442 VM& vm = state->vm(); 443 auto throwScope = DECLARE_THROW_SCOPE(vm); 444 UNUSED_PARAM(throwScope); 445 UNUSED_PARAM(thisValue); 446 JSValue decodedThisValue = JSValue::decode(thisValue); 447 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); 448 if (UNLIKELY(!castedThis)) { 449 return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsStr1"); 450 } 451 auto& impl = castedThis->wrapped(); 457 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr1Getter>(state, thisValue, "implementsStr1"); 458 } 459 460 static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 461 { 462 UNUSED_PARAM(throwScope); 463 UNUSED_PARAM(state); 464 auto& impl = thisObject->wrapped(); 452 465 JSValue result = jsStringWithCache(state, impl.implementsStr1()); 453 return JSValue::encode(result); 454 } 455 456 #endif 457 458 #if ENABLE(Condition22) || ENABLE(Condition23) 466 return result; 467 } 468 469 #endif 470 471 #if ENABLE(Condition22) || ENABLE(Condition23) 472 static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 473 459 474 EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, PropertyName) 460 475 { 461 VM& vm = state->vm(); 462 auto throwScope = DECLARE_THROW_SCOPE(vm); 463 UNUSED_PARAM(throwScope); 464 UNUSED_PARAM(thisValue); 465 JSValue decodedThisValue = JSValue::decode(thisValue); 466 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); 467 if (UNLIKELY(!castedThis)) { 468 return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsStr2"); 469 } 470 auto& impl = castedThis->wrapped(); 476 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr2Getter>(state, thisValue, "implementsStr2"); 477 } 478 479 static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 480 { 481 UNUSED_PARAM(throwScope); 482 UNUSED_PARAM(state); 483 auto& impl = thisObject->wrapped(); 471 484 JSValue result = jsStringWithCache(state, impl.implementsStr2()); 472 return JSValue::encode(result); 473 } 474 475 #endif 476 477 #if ENABLE(Condition22) || ENABLE(Condition23) 485 return result; 486 } 487 488 #endif 489 490 #if ENABLE(Condition22) || ENABLE(Condition23) 491 static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 492 478 493 EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, PropertyName) 479 494 { 480 VM& vm = state->vm();481 auto throwScope = DECLARE_THROW_SCOPE(vm); 482 UNUSED_PARAM(throwScope); 483 UNUSED_PARAM(thisValue); 484 JSValue decodedThisValue = JSValue::decode(thisValue); 485 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);486 if (UNLIKELY(!castedThis)) {487 return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsStr3");488 489 return JSValue::encode(castedThis->implementsStr3(*state)); 490 } 491 492 # endif493 494 #if ENABLE(Condition22) || ENABLE(Condition23) 495 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr3Getter>(state, thisValue, "implementsStr3"); 496 } 497 498 static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 499 { 500 UNUSED_PARAM(throwScope); 501 UNUSED_PARAM(state); 502 return thisObject->implementsStr3(*state); 503 } 504 505 #endif 506 507 #if ENABLE(Condition22) || ENABLE(Condition23) 508 static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 509 495 510 EncodedJSValue jsTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, PropertyName) 496 511 { 497 VM& vm = state->vm(); 498 auto throwScope = DECLARE_THROW_SCOPE(vm); 499 UNUSED_PARAM(throwScope); 500 UNUSED_PARAM(thisValue); 501 JSValue decodedThisValue = JSValue::decode(thisValue); 502 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); 503 if (UNLIKELY(!castedThis)) { 504 return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsNode"); 505 } 506 auto& impl = castedThis->wrapped(); 507 JSValue result = toJS(state, castedThis->globalObject(), impl.implementsNode()); 508 return JSValue::encode(result); 509 } 510 511 #endif 512 513 #if ENABLE(Condition11) || ENABLE(Condition12) 514 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 515 { 516 VM& vm = state->vm(); 517 auto throwScope = DECLARE_THROW_SCOPE(vm); 518 UNUSED_PARAM(throwScope); 519 UNUSED_PARAM(thisValue); 512 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsNodeGetter>(state, thisValue, "implementsNode"); 513 } 514 515 static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 516 { 517 UNUSED_PARAM(throwScope); 518 UNUSED_PARAM(state); 519 auto& impl = thisObject->wrapped(); 520 JSValue result = toJS(state, thisObject->globalObject(), impl.implementsNode()); 521 return result; 522 } 523 524 #endif 525 526 #if ENABLE(Condition11) || ENABLE(Condition12) 527 static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState*); 528 529 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue, PropertyName) 530 { 531 return JSValue::encode(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(state)); 532 } 533 534 static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState* state) 535 { 536 UNUSED_PARAM(state); 520 537 JSValue result = jsNumber(WebCore::TestSupplemental::supplementalStaticReadOnlyAttr()); 521 return JSValue::encode(result); 522 } 523 524 #endif 525 526 #if ENABLE(Condition11) || ENABLE(Condition12) 527 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 528 { 529 VM& vm = state->vm(); 530 auto throwScope = DECLARE_THROW_SCOPE(vm); 531 UNUSED_PARAM(throwScope); 532 UNUSED_PARAM(thisValue); 538 return result; 539 } 540 541 #endif 542 543 #if ENABLE(Condition11) || ENABLE(Condition12) 544 static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState*); 545 546 EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue, PropertyName) 547 { 548 return JSValue::encode(jsTestInterfaceConstructorSupplementalStaticAttrGetter(state)); 549 } 550 551 static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState* state) 552 { 553 UNUSED_PARAM(state); 533 554 JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStaticAttr()); 534 return JSValue::encode(result); 535 } 536 537 #endif 538 539 #if ENABLE(Condition11) || ENABLE(Condition12) 555 return result; 556 } 557 558 #endif 559 560 #if ENABLE(Condition11) || ENABLE(Condition12) 561 static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 562 540 563 EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* state, EncodedJSValue thisValue, PropertyName) 541 564 { 542 VM& vm = state->vm(); 543 auto throwScope = DECLARE_THROW_SCOPE(vm); 544 UNUSED_PARAM(throwScope); 545 UNUSED_PARAM(thisValue); 546 JSValue decodedThisValue = JSValue::decode(thisValue); 547 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); 548 if (UNLIKELY(!castedThis)) { 549 return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalStr1"); 550 } 551 auto& impl = castedThis->wrapped(); 565 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr1Getter>(state, thisValue, "supplementalStr1"); 566 } 567 568 static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 569 { 570 UNUSED_PARAM(throwScope); 571 UNUSED_PARAM(state); 572 auto& impl = thisObject->wrapped(); 552 573 JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr1(impl)); 553 return JSValue::encode(result); 554 } 555 556 #endif 557 558 #if ENABLE(Condition11) || ENABLE(Condition12) 574 return result; 575 } 576 577 #endif 578 579 #if ENABLE(Condition11) || ENABLE(Condition12) 580 static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 581 559 582 EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, PropertyName) 560 583 { 561 VM& vm = state->vm(); 562 auto throwScope = DECLARE_THROW_SCOPE(vm); 563 UNUSED_PARAM(throwScope); 564 UNUSED_PARAM(thisValue); 565 JSValue decodedThisValue = JSValue::decode(thisValue); 566 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); 567 if (UNLIKELY(!castedThis)) { 568 return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalStr2"); 569 } 570 auto& impl = castedThis->wrapped(); 584 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr2Getter>(state, thisValue, "supplementalStr2"); 585 } 586 587 static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 588 { 589 UNUSED_PARAM(throwScope); 590 UNUSED_PARAM(state); 591 auto& impl = thisObject->wrapped(); 571 592 JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr2(impl)); 572 return JSValue::encode(result); 573 } 574 575 #endif 576 577 #if ENABLE(Condition11) || ENABLE(Condition12) 593 return result; 594 } 595 596 #endif 597 598 #if ENABLE(Condition11) || ENABLE(Condition12) 599 static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 600 578 601 EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, PropertyName) 579 602 { 580 VM& vm = state->vm();581 auto throwScope = DECLARE_THROW_SCOPE(vm); 582 UNUSED_PARAM(throwScope); 583 UNUSED_PARAM(thisValue); 584 JSValue decodedThisValue = JSValue::decode(thisValue); 585 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);586 if (UNLIKELY(!castedThis)) {587 return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalStr3");588 589 return JSValue::encode(castedThis->supplementalStr3(*state)); 590 } 591 592 # endif593 594 #if ENABLE(Condition11) || ENABLE(Condition12) 603 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr3Getter>(state, thisValue, "supplementalStr3"); 604 } 605 606 static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 607 { 608 UNUSED_PARAM(throwScope); 609 UNUSED_PARAM(state); 610 return thisObject->supplementalStr3(*state); 611 } 612 613 #endif 614 615 #if ENABLE(Condition11) || ENABLE(Condition12) 616 static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState*, JSTestInterface*, ThrowScope& throwScope); 617 595 618 EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, PropertyName) 596 619 { 597 VM& vm = state->vm(); 598 auto throwScope = DECLARE_THROW_SCOPE(vm); 599 UNUSED_PARAM(throwScope); 600 UNUSED_PARAM(thisValue); 601 JSValue decodedThisValue = JSValue::decode(thisValue); 602 auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); 603 if (UNLIKELY(!castedThis)) { 604 return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalNode"); 605 } 606 auto& impl = castedThis->wrapped(); 607 JSValue result = toJS(state, castedThis->globalObject(), WebCore::TestSupplemental::supplementalNode(impl)); 608 return JSValue::encode(result); 620 return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalNodeGetter>(state, thisValue, "supplementalNode"); 621 } 622 623 static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope) 624 { 625 UNUSED_PARAM(throwScope); 626 UNUSED_PARAM(state); 627 auto& impl = thisObject->wrapped(); 628 JSValue result = toJS(state, thisObject->globalObject(), WebCore::TestSupplemental::supplementalNode(impl)); 629 return result; 609 630 } 610 631 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
r206723 r206953 55 55 56 56 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 57 static JSTestInterface* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 57 58 58 59 // Custom attributes -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp
r206723 r206953 133 133 } 134 134 135 inline JSTestJSBuiltinConstructor* JSTestJSBuiltinConstructor::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 136 { 137 return jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue)); 138 } 139 140 static inline JSValue jsTestJSBuiltinConstructorTestAttributeCustomGetter(ExecState*, JSTestJSBuiltinConstructor*, ThrowScope& throwScope); 141 135 142 EncodedJSValue jsTestJSBuiltinConstructorTestAttributeCustom(ExecState* state, EncodedJSValue thisValue, PropertyName) 136 143 { 137 VM& vm = state->vm(); 138 auto throwScope = DECLARE_THROW_SCOPE(vm); 139 UNUSED_PARAM(throwScope); 140 UNUSED_PARAM(thisValue); 141 JSValue decodedThisValue = JSValue::decode(thisValue); 142 auto* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(decodedThisValue); 143 if (UNLIKELY(!castedThis)) { 144 return throwGetterTypeError(*state, throwScope, "TestJSBuiltinConstructor", "testAttributeCustom"); 145 } 146 return JSValue::encode(castedThis->testAttributeCustom(*state)); 147 } 148 144 return BindingCaller<JSTestJSBuiltinConstructor>::attribute<jsTestJSBuiltinConstructorTestAttributeCustomGetter>(state, thisValue, "testAttributeCustom"); 145 } 146 147 static inline JSValue jsTestJSBuiltinConstructorTestAttributeCustomGetter(ExecState* state, JSTestJSBuiltinConstructor* thisObject, ThrowScope& throwScope) 148 { 149 UNUSED_PARAM(throwScope); 150 UNUSED_PARAM(state); 151 return thisObject->testAttributeCustom(*state); 152 } 153 154 static inline JSValue jsTestJSBuiltinConstructorTestAttributeRWCustomGetter(ExecState*, JSTestJSBuiltinConstructor*, ThrowScope& throwScope); 149 155 150 156 EncodedJSValue jsTestJSBuiltinConstructorTestAttributeRWCustom(ExecState* state, EncodedJSValue thisValue, PropertyName) 151 157 { 152 VM& vm = state->vm(); 153 auto throwScope = DECLARE_THROW_SCOPE(vm); 154 UNUSED_PARAM(throwScope); 155 UNUSED_PARAM(thisValue); 156 JSValue decodedThisValue = JSValue::decode(thisValue); 157 auto* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(decodedThisValue); 158 if (UNLIKELY(!castedThis)) { 159 return throwGetterTypeError(*state, throwScope, "TestJSBuiltinConstructor", "testAttributeRWCustom"); 160 } 161 return JSValue::encode(castedThis->testAttributeRWCustom(*state)); 162 } 163 158 return BindingCaller<JSTestJSBuiltinConstructor>::attribute<jsTestJSBuiltinConstructorTestAttributeRWCustomGetter>(state, thisValue, "testAttributeRWCustom"); 159 } 160 161 static inline JSValue jsTestJSBuiltinConstructorTestAttributeRWCustomGetter(ExecState* state, JSTestJSBuiltinConstructor* thisObject, ThrowScope& throwScope) 162 { 163 UNUSED_PARAM(throwScope); 164 UNUSED_PARAM(state); 165 return thisObject->testAttributeRWCustom(*state); 166 } 164 167 165 168 EncodedJSValue jsTestJSBuiltinConstructorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h
r206723 r206953 47 47 48 48 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 49 static JSTestJSBuiltinConstructor* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 49 50 static void visitChildren(JSCell*, JSC::SlotVisitor&); 50 51 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
r206723 r206953 169 169 } 170 170 171 inline JSTestNode* JSTestNode::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 172 { 173 return jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue)); 174 } 175 176 static inline JSValue jsTestNodeNameGetter(ExecState*, JSTestNode*, ThrowScope& throwScope); 177 171 178 EncodedJSValue jsTestNodeName(ExecState* state, EncodedJSValue thisValue, PropertyName) 172 179 { 173 VM& vm = state->vm(); 174 auto throwScope = DECLARE_THROW_SCOPE(vm); 180 return BindingCaller<JSTestNode>::attribute<jsTestNodeNameGetter>(state, thisValue, "name"); 181 } 182 183 static inline JSValue jsTestNodeNameGetter(ExecState* state, JSTestNode* thisObject, ThrowScope& throwScope) 184 { 175 185 UNUSED_PARAM(throwScope); 176 UNUSED_PARAM(thisValue); 177 JSValue decodedThisValue = JSValue::decode(thisValue); 178 auto* castedThis = jsDynamicCast<JSTestNode*>(decodedThisValue); 179 if (UNLIKELY(!castedThis)) { 180 return throwGetterTypeError(*state, throwScope, "TestNode", "name"); 181 } 182 auto& impl = castedThis->wrapped(); 186 UNUSED_PARAM(state); 187 auto& impl = thisObject->wrapped(); 183 188 JSValue result = jsStringWithCache(state, impl.name()); 184 return JSValue::encode(result); 185 } 186 189 return result; 190 } 187 191 188 192 EncodedJSValue jsTestNodeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h
r206723 r206953 48 48 49 49 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 50 static JSTestNode* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 50 51 static void visitChildren(JSCell*, JSC::SlotVisitor&); 51 52 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
r206723 r206953 144 144 } 145 145 146 inline JSTestNondeterministic* JSTestNondeterministic::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 147 { 148 return jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue)); 149 } 150 151 static inline JSValue jsTestNondeterministicNondeterministicReadonlyAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope); 152 146 153 EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 147 154 { 148 VM& vm = state->vm(); 149 auto throwScope = DECLARE_THROW_SCOPE(vm); 150 UNUSED_PARAM(throwScope); 151 UNUSED_PARAM(thisValue); 152 JSValue decodedThisValue = JSValue::decode(thisValue); 153 auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue); 154 if (UNLIKELY(!castedThis)) { 155 return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicReadonlyAttr"); 156 } 155 return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicReadonlyAttrGetter>(state, thisValue, "nondeterministicReadonlyAttr"); 156 } 157 158 static inline JSValue jsTestNondeterministicNondeterministicReadonlyAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope) 159 { 160 UNUSED_PARAM(throwScope); 161 UNUSED_PARAM(state); 157 162 #if ENABLE(WEB_REPLAY) 158 163 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 160 165 static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicReadonlyAttr", AtomicString::ConstructFromLiteral); 161 166 if (cursor.isCapturing()) { 162 int32_t memoizedResult = castedThis->wrapped().nondeterministicReadonlyAttr();167 int32_t memoizedResult = thisObject->wrapped().nondeterministicReadonlyAttr(); 163 168 cursor.appendInput<MemoizedDOMResult<int32_t>>(bindingName.get().string(), memoizedResult, 0); 164 169 JSValue result = jsNumber(memoizedResult); 165 return JSValue::encode(result);170 return result; 166 171 } 167 172 … … 171 176 if (input && input->convertTo<int32_t>(memoizedResult)) { 172 177 JSValue result = jsNumber(memoizedResult); 173 return JSValue::encode(result);178 return result; 174 179 } 175 180 } 176 181 #endif 177 auto& impl = castedThis->wrapped();182 auto& impl = thisObject->wrapped(); 178 183 JSValue result = jsNumber(impl.nondeterministicReadonlyAttr()); 179 return JSValue::encode(result); 180 } 181 184 return result; 185 } 186 187 static inline JSValue jsTestNondeterministicNondeterministicWriteableAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope); 182 188 183 189 EncodedJSValue jsTestNondeterministicNondeterministicWriteableAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 184 190 { 185 VM& vm = state->vm(); 186 auto throwScope = DECLARE_THROW_SCOPE(vm); 187 UNUSED_PARAM(throwScope); 188 UNUSED_PARAM(thisValue); 189 JSValue decodedThisValue = JSValue::decode(thisValue); 190 auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue); 191 if (UNLIKELY(!castedThis)) { 192 return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicWriteableAttr"); 193 } 191 return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicWriteableAttrGetter>(state, thisValue, "nondeterministicWriteableAttr"); 192 } 193 194 static inline JSValue jsTestNondeterministicNondeterministicWriteableAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope) 195 { 196 UNUSED_PARAM(throwScope); 197 UNUSED_PARAM(state); 194 198 #if ENABLE(WEB_REPLAY) 195 199 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 197 201 static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicWriteableAttr", AtomicString::ConstructFromLiteral); 198 202 if (cursor.isCapturing()) { 199 String memoizedResult = castedThis->wrapped().nondeterministicWriteableAttr();203 String memoizedResult = thisObject->wrapped().nondeterministicWriteableAttr(); 200 204 cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0); 201 205 JSValue result = jsStringWithCache(state, memoizedResult); 202 return JSValue::encode(result);206 return result; 203 207 } 204 208 … … 208 212 if (input && input->convertTo<String>(memoizedResult)) { 209 213 JSValue result = jsStringWithCache(state, memoizedResult); 210 return JSValue::encode(result);214 return result; 211 215 } 212 216 } 213 217 #endif 214 auto& impl = castedThis->wrapped();218 auto& impl = thisObject->wrapped(); 215 219 JSValue result = jsStringWithCache(state, impl.nondeterministicWriteableAttr()); 216 return JSValue::encode(result); 217 } 218 220 return result; 221 } 222 223 static inline JSValue jsTestNondeterministicNondeterministicExceptionAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope); 219 224 220 225 EncodedJSValue jsTestNondeterministicNondeterministicExceptionAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 221 226 { 222 VM& vm = state->vm(); 223 auto throwScope = DECLARE_THROW_SCOPE(vm); 224 UNUSED_PARAM(throwScope); 225 UNUSED_PARAM(thisValue); 226 JSValue decodedThisValue = JSValue::decode(thisValue); 227 auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue); 228 if (UNLIKELY(!castedThis)) { 229 return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicExceptionAttr"); 230 } 227 return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicExceptionAttrGetter>(state, thisValue, "nondeterministicExceptionAttr"); 228 } 229 230 static inline JSValue jsTestNondeterministicNondeterministicExceptionAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope) 231 { 232 UNUSED_PARAM(throwScope); 233 UNUSED_PARAM(state); 231 234 #if ENABLE(WEB_REPLAY) 232 235 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 234 237 static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicExceptionAttr", AtomicString::ConstructFromLiteral); 235 238 if (cursor.isCapturing()) { 236 String memoizedResult = castedThis->wrapped().nondeterministicExceptionAttr();239 String memoizedResult = thisObject->wrapped().nondeterministicExceptionAttr(); 237 240 cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0); 238 241 JSValue result = jsStringWithCache(state, memoizedResult); 239 return JSValue::encode(result);242 return result; 240 243 } 241 244 … … 245 248 if (input && input->convertTo<String>(memoizedResult)) { 246 249 JSValue result = jsStringWithCache(state, memoizedResult); 247 return JSValue::encode(result);250 return result; 248 251 } 249 252 } 250 253 #endif 251 auto& impl = castedThis->wrapped();254 auto& impl = thisObject->wrapped(); 252 255 JSValue result = jsStringWithCache(state, impl.nondeterministicExceptionAttr()); 253 return JSValue::encode(result); 254 } 255 256 return result; 257 } 258 259 static inline JSValue jsTestNondeterministicNondeterministicGetterExceptionAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope); 256 260 257 261 EncodedJSValue jsTestNondeterministicNondeterministicGetterExceptionAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 258 262 { 259 VM& vm = state->vm(); 260 auto throwScope = DECLARE_THROW_SCOPE(vm); 261 UNUSED_PARAM(throwScope); 262 UNUSED_PARAM(thisValue); 263 JSValue decodedThisValue = JSValue::decode(thisValue); 264 auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue); 265 if (UNLIKELY(!castedThis)) { 266 return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicGetterExceptionAttr"); 267 } 263 return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicGetterExceptionAttrGetter>(state, thisValue, "nondeterministicGetterExceptionAttr"); 264 } 265 266 static inline JSValue jsTestNondeterministicNondeterministicGetterExceptionAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope) 267 { 268 UNUSED_PARAM(throwScope); 269 UNUSED_PARAM(state); 268 270 ExceptionCode ec = 0; 269 271 #if ENABLE(WEB_REPLAY) … … 272 274 static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicGetterExceptionAttr", AtomicString::ConstructFromLiteral); 273 275 if (cursor.isCapturing()) { 274 String memoizedResult = castedThis->wrapped().nondeterministicGetterExceptionAttr(ec);276 String memoizedResult = thisObject->wrapped().nondeterministicGetterExceptionAttr(ec); 275 277 cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, ec); 276 278 JSValue result = jsStringWithCache(state, memoizedResult); 277 279 setDOMException(state, throwScope, ec); 278 return JSValue::encode(result);280 return result; 279 281 } 280 282 … … 285 287 JSValue result = jsStringWithCache(state, memoizedResult); 286 288 setDOMException(state, throwScope, input->exceptionCode()); 287 return JSValue::encode(result);289 return result; 288 290 } 289 291 } 290 292 #endif 291 auto& impl = castedThis->wrapped();293 auto& impl = thisObject->wrapped(); 292 294 JSValue result = jsStringWithCache(state, impl.nondeterministicGetterExceptionAttr(ec)); 293 295 setDOMException(state, throwScope, ec); 294 return JSValue::encode(result); 295 } 296 296 return result; 297 } 298 299 static inline JSValue jsTestNondeterministicNondeterministicSetterExceptionAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope); 297 300 298 301 EncodedJSValue jsTestNondeterministicNondeterministicSetterExceptionAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 299 302 { 300 VM& vm = state->vm(); 301 auto throwScope = DECLARE_THROW_SCOPE(vm); 302 UNUSED_PARAM(throwScope); 303 UNUSED_PARAM(thisValue); 304 JSValue decodedThisValue = JSValue::decode(thisValue); 305 auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue); 306 if (UNLIKELY(!castedThis)) { 307 return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicSetterExceptionAttr"); 308 } 303 return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicSetterExceptionAttrGetter>(state, thisValue, "nondeterministicSetterExceptionAttr"); 304 } 305 306 static inline JSValue jsTestNondeterministicNondeterministicSetterExceptionAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope) 307 { 308 UNUSED_PARAM(throwScope); 309 UNUSED_PARAM(state); 309 310 #if ENABLE(WEB_REPLAY) 310 311 JSGlobalObject* globalObject = state->lexicalGlobalObject(); … … 312 313 static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicSetterExceptionAttr", AtomicString::ConstructFromLiteral); 313 314 if (cursor.isCapturing()) { 314 String memoizedResult = castedThis->wrapped().nondeterministicSetterExceptionAttr();315 String memoizedResult = thisObject->wrapped().nondeterministicSetterExceptionAttr(); 315 316 cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0); 316 317 JSValue result = jsStringWithCache(state, memoizedResult); 317 return JSValue::encode(result);318 return result; 318 319 } 319 320 … … 323 324 if (input && input->convertTo<String>(memoizedResult)) { 324 325 JSValue result = jsStringWithCache(state, memoizedResult); 325 return JSValue::encode(result);326 return result; 326 327 } 327 328 } 328 329 #endif 329 auto& impl = castedThis->wrapped();330 auto& impl = thisObject->wrapped(); 330 331 JSValue result = jsStringWithCache(state, impl.nondeterministicSetterExceptionAttr()); 331 return JSValue::encode(result); 332 } 333 332 return result; 333 } 334 334 335 335 EncodedJSValue jsTestNondeterministicConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h
r206723 r206953 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static JSTestNondeterministic* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 52 53 protected: 53 54 JSTestNondeterministic(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNondeterministic>&&); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r206877 r206953 1712 1712 } 1713 1713 1714 inline JSTestObj* JSTestObj::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 1715 { 1716 return jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue)); 1717 } 1718 1719 static inline JSValue jsTestObjReadOnlyLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1720 1714 1721 EncodedJSValue jsTestObjReadOnlyLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1715 1722 { 1716 VM& vm = state->vm(); 1717 auto throwScope = DECLARE_THROW_SCOPE(vm); 1718 UNUSED_PARAM(throwScope); 1719 UNUSED_PARAM(thisValue); 1720 JSValue decodedThisValue = JSValue::decode(thisValue); 1721 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1722 if (UNLIKELY(!castedThis)) { 1723 return throwGetterTypeError(*state, throwScope, "TestObject", "readOnlyLongAttr"); 1724 } 1725 auto& impl = castedThis->wrapped(); 1723 return BindingCaller<JSTestObj>::attribute<jsTestObjReadOnlyLongAttrGetter>(state, thisValue, "readOnlyLongAttr"); 1724 } 1725 1726 static inline JSValue jsTestObjReadOnlyLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1727 { 1728 UNUSED_PARAM(throwScope); 1729 UNUSED_PARAM(state); 1730 auto& impl = thisObject->wrapped(); 1726 1731 JSValue result = jsNumber(impl.readOnlyLongAttr()); 1727 return JSValue::encode(result); 1728 } 1729 1732 return result; 1733 } 1734 1735 static inline JSValue jsTestObjReadOnlyStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1730 1736 1731 1737 EncodedJSValue jsTestObjReadOnlyStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1732 1738 { 1733 VM& vm = state->vm(); 1734 auto throwScope = DECLARE_THROW_SCOPE(vm); 1735 UNUSED_PARAM(throwScope); 1736 UNUSED_PARAM(thisValue); 1737 JSValue decodedThisValue = JSValue::decode(thisValue); 1738 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1739 if (UNLIKELY(!castedThis)) { 1740 return throwGetterTypeError(*state, throwScope, "TestObject", "readOnlyStringAttr"); 1741 } 1742 auto& impl = castedThis->wrapped(); 1739 return BindingCaller<JSTestObj>::attribute<jsTestObjReadOnlyStringAttrGetter>(state, thisValue, "readOnlyStringAttr"); 1740 } 1741 1742 static inline JSValue jsTestObjReadOnlyStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1743 { 1744 UNUSED_PARAM(throwScope); 1745 UNUSED_PARAM(state); 1746 auto& impl = thisObject->wrapped(); 1743 1747 JSValue result = jsStringWithCache(state, impl.readOnlyStringAttr()); 1744 return JSValue::encode(result); 1745 } 1746 1748 return result; 1749 } 1750 1751 static inline JSValue jsTestObjReadOnlyTestObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1747 1752 1748 1753 EncodedJSValue jsTestObjReadOnlyTestObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1749 1754 { 1750 VM& vm = state->vm(); 1751 auto throwScope = DECLARE_THROW_SCOPE(vm); 1752 UNUSED_PARAM(throwScope); 1753 UNUSED_PARAM(thisValue); 1754 JSValue decodedThisValue = JSValue::decode(thisValue); 1755 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1756 if (UNLIKELY(!castedThis)) { 1757 return throwGetterTypeError(*state, throwScope, "TestObject", "readOnlyTestObjAttr"); 1758 } 1759 auto& impl = castedThis->wrapped(); 1760 JSValue result = toJS(state, castedThis->globalObject(), impl.readOnlyTestObjAttr()); 1761 return JSValue::encode(result); 1762 } 1763 1764 1765 EncodedJSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1766 { 1767 VM& vm = state->vm(); 1768 auto throwScope = DECLARE_THROW_SCOPE(vm); 1769 UNUSED_PARAM(throwScope); 1770 UNUSED_PARAM(thisValue); 1755 return BindingCaller<JSTestObj>::attribute<jsTestObjReadOnlyTestObjAttrGetter>(state, thisValue, "readOnlyTestObjAttr"); 1756 } 1757 1758 static inline JSValue jsTestObjReadOnlyTestObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1759 { 1760 UNUSED_PARAM(throwScope); 1761 UNUSED_PARAM(state); 1762 auto& impl = thisObject->wrapped(); 1763 JSValue result = toJS(state, thisObject->globalObject(), impl.readOnlyTestObjAttr()); 1764 return result; 1765 } 1766 1767 static inline JSValue jsTestObjConstructorStaticReadOnlyLongAttrGetter(ExecState*); 1768 1769 EncodedJSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* state, EncodedJSValue, PropertyName) 1770 { 1771 return JSValue::encode(jsTestObjConstructorStaticReadOnlyLongAttrGetter(state)); 1772 } 1773 1774 static inline JSValue jsTestObjConstructorStaticReadOnlyLongAttrGetter(ExecState* state) 1775 { 1776 UNUSED_PARAM(state); 1771 1777 JSValue result = jsNumber(TestObj::staticReadOnlyLongAttr()); 1772 return JSValue::encode(result); 1773 } 1774 1775 1776 EncodedJSValue jsTestObjConstructorStaticStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1777 { 1778 VM& vm = state->vm(); 1779 auto throwScope = DECLARE_THROW_SCOPE(vm); 1780 UNUSED_PARAM(throwScope); 1781 UNUSED_PARAM(thisValue); 1778 return result; 1779 } 1780 1781 static inline JSValue jsTestObjConstructorStaticStringAttrGetter(ExecState*); 1782 1783 EncodedJSValue jsTestObjConstructorStaticStringAttr(ExecState* state, EncodedJSValue, PropertyName) 1784 { 1785 return JSValue::encode(jsTestObjConstructorStaticStringAttrGetter(state)); 1786 } 1787 1788 static inline JSValue jsTestObjConstructorStaticStringAttrGetter(ExecState* state) 1789 { 1790 UNUSED_PARAM(state); 1782 1791 JSValue result = jsStringWithCache(state, TestObj::staticStringAttr()); 1783 return JSValue::encode(result); 1784 } 1785 1792 return result; 1793 } 1794 1795 static inline JSValue jsTestObjConstructorTestSubObjGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1786 1796 1787 1797 EncodedJSValue jsTestObjConstructorTestSubObj(ExecState* state, EncodedJSValue thisValue, PropertyName) 1788 1798 { 1789 VM& vm = state->vm(); 1790 auto throwScope = DECLARE_THROW_SCOPE(vm); 1791 UNUSED_PARAM(throwScope); 1792 UNUSED_PARAM(thisValue); 1793 JSValue decodedThisValue = JSValue::decode(thisValue); 1794 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1795 if (UNLIKELY(!castedThis)) { 1796 return throwGetterTypeError(*state, throwScope, "TestObject", "TestSubObj"); 1797 } 1798 return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject())); 1799 } 1800 1799 return BindingCaller<JSTestObj>::attribute<jsTestObjConstructorTestSubObjGetter>(state, thisValue, "TestSubObj"); 1800 } 1801 1802 static inline JSValue jsTestObjConstructorTestSubObjGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1803 { 1804 UNUSED_PARAM(throwScope); 1805 UNUSED_PARAM(state); 1806 return JSTestSubObj::getConstructor(state->vm(), thisObject->globalObject()); 1807 } 1808 1809 static inline JSValue jsTestObjTestSubObjEnabledBySettingConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1801 1810 1802 1811 EncodedJSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) 1803 1812 { 1804 VM& vm = state->vm(); 1805 auto throwScope = DECLARE_THROW_SCOPE(vm); 1806 UNUSED_PARAM(throwScope); 1807 UNUSED_PARAM(thisValue); 1808 JSValue decodedThisValue = JSValue::decode(thisValue); 1809 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1810 if (UNLIKELY(!castedThis)) { 1811 return throwGetterTypeError(*state, throwScope, "TestObject", "TestSubObjEnabledBySetting"); 1812 } 1813 if (UNLIKELY(!castedThis->wrapped().frame())) 1814 return JSValue::encode(jsUndefined()); 1815 Settings& settings = castedThis->wrapped().frame()->settings(); 1813 return BindingCaller<JSTestObj>::attribute<jsTestObjTestSubObjEnabledBySettingConstructorGetter>(state, thisValue, "TestSubObjEnabledBySetting"); 1814 } 1815 1816 static inline JSValue jsTestObjTestSubObjEnabledBySettingConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1817 { 1818 UNUSED_PARAM(throwScope); 1819 UNUSED_PARAM(state); 1820 if (UNLIKELY(!thisObject->wrapped().frame())) 1821 return jsUndefined(); 1822 Settings& settings = thisObject->wrapped().frame()->settings(); 1816 1823 if (!settings.testSettingEnabled()) 1817 return JSValue::encode(jsUndefined()); 1818 return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject())); 1819 } 1820 1824 return jsUndefined(); 1825 return JSTestSubObj::getConstructor(state->vm(), thisObject->globalObject()); 1826 } 1827 1828 static inline JSValue jsTestObjEnumAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1821 1829 1822 1830 EncodedJSValue jsTestObjEnumAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1823 1831 { 1824 VM& vm = state->vm(); 1825 auto throwScope = DECLARE_THROW_SCOPE(vm); 1826 UNUSED_PARAM(throwScope); 1827 UNUSED_PARAM(thisValue); 1828 JSValue decodedThisValue = JSValue::decode(thisValue); 1829 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1830 if (UNLIKELY(!castedThis)) { 1831 return throwGetterTypeError(*state, throwScope, "TestObject", "enumAttr"); 1832 } 1833 auto& impl = castedThis->wrapped(); 1832 return BindingCaller<JSTestObj>::attribute<jsTestObjEnumAttrGetter>(state, thisValue, "enumAttr"); 1833 } 1834 1835 static inline JSValue jsTestObjEnumAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1836 { 1837 UNUSED_PARAM(throwScope); 1838 UNUSED_PARAM(state); 1839 auto& impl = thisObject->wrapped(); 1834 1840 JSValue result = jsStringWithCache(state, impl.enumAttr()); 1835 return JSValue::encode(result); 1836 } 1837 1841 return result; 1842 } 1843 1844 static inline JSValue jsTestObjByteAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1838 1845 1839 1846 EncodedJSValue jsTestObjByteAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1840 1847 { 1841 VM& vm = state->vm(); 1842 auto throwScope = DECLARE_THROW_SCOPE(vm); 1843 UNUSED_PARAM(throwScope); 1844 UNUSED_PARAM(thisValue); 1845 JSValue decodedThisValue = JSValue::decode(thisValue); 1846 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1847 if (UNLIKELY(!castedThis)) { 1848 return throwGetterTypeError(*state, throwScope, "TestObject", "byteAttr"); 1849 } 1850 auto& impl = castedThis->wrapped(); 1848 return BindingCaller<JSTestObj>::attribute<jsTestObjByteAttrGetter>(state, thisValue, "byteAttr"); 1849 } 1850 1851 static inline JSValue jsTestObjByteAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1852 { 1853 UNUSED_PARAM(throwScope); 1854 UNUSED_PARAM(state); 1855 auto& impl = thisObject->wrapped(); 1851 1856 JSValue result = jsNumber(impl.byteAttr()); 1852 return JSValue::encode(result); 1853 } 1854 1857 return result; 1858 } 1859 1860 static inline JSValue jsTestObjOctetAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1855 1861 1856 1862 EncodedJSValue jsTestObjOctetAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1857 1863 { 1858 VM& vm = state->vm(); 1859 auto throwScope = DECLARE_THROW_SCOPE(vm); 1860 UNUSED_PARAM(throwScope); 1861 UNUSED_PARAM(thisValue); 1862 JSValue decodedThisValue = JSValue::decode(thisValue); 1863 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1864 if (UNLIKELY(!castedThis)) { 1865 return throwGetterTypeError(*state, throwScope, "TestObject", "octetAttr"); 1866 } 1867 auto& impl = castedThis->wrapped(); 1864 return BindingCaller<JSTestObj>::attribute<jsTestObjOctetAttrGetter>(state, thisValue, "octetAttr"); 1865 } 1866 1867 static inline JSValue jsTestObjOctetAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1868 { 1869 UNUSED_PARAM(throwScope); 1870 UNUSED_PARAM(state); 1871 auto& impl = thisObject->wrapped(); 1868 1872 JSValue result = jsNumber(impl.octetAttr()); 1869 return JSValue::encode(result); 1870 } 1871 1873 return result; 1874 } 1875 1876 static inline JSValue jsTestObjShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1872 1877 1873 1878 EncodedJSValue jsTestObjShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1874 1879 { 1875 VM& vm = state->vm(); 1876 auto throwScope = DECLARE_THROW_SCOPE(vm); 1877 UNUSED_PARAM(throwScope); 1878 UNUSED_PARAM(thisValue); 1879 JSValue decodedThisValue = JSValue::decode(thisValue); 1880 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1881 if (UNLIKELY(!castedThis)) { 1882 return throwGetterTypeError(*state, throwScope, "TestObject", "shortAttr"); 1883 } 1884 auto& impl = castedThis->wrapped(); 1880 return BindingCaller<JSTestObj>::attribute<jsTestObjShortAttrGetter>(state, thisValue, "shortAttr"); 1881 } 1882 1883 static inline JSValue jsTestObjShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1884 { 1885 UNUSED_PARAM(throwScope); 1886 UNUSED_PARAM(state); 1887 auto& impl = thisObject->wrapped(); 1885 1888 JSValue result = jsNumber(impl.shortAttr()); 1886 return JSValue::encode(result); 1887 } 1888 1889 return result; 1890 } 1891 1892 static inline JSValue jsTestObjClampedShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1889 1893 1890 1894 EncodedJSValue jsTestObjClampedShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1891 1895 { 1892 VM& vm = state->vm(); 1893 auto throwScope = DECLARE_THROW_SCOPE(vm); 1894 UNUSED_PARAM(throwScope); 1895 UNUSED_PARAM(thisValue); 1896 JSValue decodedThisValue = JSValue::decode(thisValue); 1897 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1898 if (UNLIKELY(!castedThis)) { 1899 return throwGetterTypeError(*state, throwScope, "TestObject", "clampedShortAttr"); 1900 } 1901 auto& impl = castedThis->wrapped(); 1896 return BindingCaller<JSTestObj>::attribute<jsTestObjClampedShortAttrGetter>(state, thisValue, "clampedShortAttr"); 1897 } 1898 1899 static inline JSValue jsTestObjClampedShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1900 { 1901 UNUSED_PARAM(throwScope); 1902 UNUSED_PARAM(state); 1903 auto& impl = thisObject->wrapped(); 1902 1904 JSValue result = jsNumber(impl.clampedShortAttr()); 1903 return JSValue::encode(result); 1904 } 1905 1905 return result; 1906 } 1907 1908 static inline JSValue jsTestObjEnforceRangeShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1906 1909 1907 1910 EncodedJSValue jsTestObjEnforceRangeShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1908 1911 { 1909 VM& vm = state->vm(); 1910 auto throwScope = DECLARE_THROW_SCOPE(vm); 1911 UNUSED_PARAM(throwScope); 1912 UNUSED_PARAM(thisValue); 1913 JSValue decodedThisValue = JSValue::decode(thisValue); 1914 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1915 if (UNLIKELY(!castedThis)) { 1916 return throwGetterTypeError(*state, throwScope, "TestObject", "enforceRangeShortAttr"); 1917 } 1918 auto& impl = castedThis->wrapped(); 1912 return BindingCaller<JSTestObj>::attribute<jsTestObjEnforceRangeShortAttrGetter>(state, thisValue, "enforceRangeShortAttr"); 1913 } 1914 1915 static inline JSValue jsTestObjEnforceRangeShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1916 { 1917 UNUSED_PARAM(throwScope); 1918 UNUSED_PARAM(state); 1919 auto& impl = thisObject->wrapped(); 1919 1920 JSValue result = jsNumber(impl.enforceRangeShortAttr()); 1920 return JSValue::encode(result); 1921 } 1922 1921 return result; 1922 } 1923 1924 static inline JSValue jsTestObjUnsignedShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1923 1925 1924 1926 EncodedJSValue jsTestObjUnsignedShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1925 1927 { 1926 VM& vm = state->vm(); 1927 auto throwScope = DECLARE_THROW_SCOPE(vm); 1928 UNUSED_PARAM(throwScope); 1929 UNUSED_PARAM(thisValue); 1930 JSValue decodedThisValue = JSValue::decode(thisValue); 1931 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1932 if (UNLIKELY(!castedThis)) { 1933 return throwGetterTypeError(*state, throwScope, "TestObject", "unsignedShortAttr"); 1934 } 1935 auto& impl = castedThis->wrapped(); 1928 return BindingCaller<JSTestObj>::attribute<jsTestObjUnsignedShortAttrGetter>(state, thisValue, "unsignedShortAttr"); 1929 } 1930 1931 static inline JSValue jsTestObjUnsignedShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1932 { 1933 UNUSED_PARAM(throwScope); 1934 UNUSED_PARAM(state); 1935 auto& impl = thisObject->wrapped(); 1936 1936 JSValue result = jsNumber(impl.unsignedShortAttr()); 1937 return JSValue::encode(result); 1938 } 1939 1937 return result; 1938 } 1939 1940 static inline JSValue jsTestObjLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1940 1941 1941 1942 EncodedJSValue jsTestObjLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1942 1943 { 1943 VM& vm = state->vm(); 1944 auto throwScope = DECLARE_THROW_SCOPE(vm); 1945 UNUSED_PARAM(throwScope); 1946 UNUSED_PARAM(thisValue); 1947 JSValue decodedThisValue = JSValue::decode(thisValue); 1948 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1949 if (UNLIKELY(!castedThis)) { 1950 return throwGetterTypeError(*state, throwScope, "TestObject", "longAttr"); 1951 } 1952 auto& impl = castedThis->wrapped(); 1944 return BindingCaller<JSTestObj>::attribute<jsTestObjLongAttrGetter>(state, thisValue, "longAttr"); 1945 } 1946 1947 static inline JSValue jsTestObjLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1948 { 1949 UNUSED_PARAM(throwScope); 1950 UNUSED_PARAM(state); 1951 auto& impl = thisObject->wrapped(); 1953 1952 JSValue result = jsNumber(impl.longAttr()); 1954 return JSValue::encode(result); 1955 } 1956 1953 return result; 1954 } 1955 1956 static inline JSValue jsTestObjLongLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1957 1957 1958 1958 EncodedJSValue jsTestObjLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1959 1959 { 1960 VM& vm = state->vm(); 1961 auto throwScope = DECLARE_THROW_SCOPE(vm); 1962 UNUSED_PARAM(throwScope); 1963 UNUSED_PARAM(thisValue); 1964 JSValue decodedThisValue = JSValue::decode(thisValue); 1965 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1966 if (UNLIKELY(!castedThis)) { 1967 return throwGetterTypeError(*state, throwScope, "TestObject", "longLongAttr"); 1968 } 1969 auto& impl = castedThis->wrapped(); 1960 return BindingCaller<JSTestObj>::attribute<jsTestObjLongLongAttrGetter>(state, thisValue, "longLongAttr"); 1961 } 1962 1963 static inline JSValue jsTestObjLongLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1964 { 1965 UNUSED_PARAM(throwScope); 1966 UNUSED_PARAM(state); 1967 auto& impl = thisObject->wrapped(); 1970 1968 JSValue result = jsNumber(impl.longLongAttr()); 1971 return JSValue::encode(result); 1972 } 1973 1969 return result; 1970 } 1971 1972 static inline JSValue jsTestObjUnsignedLongLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1974 1973 1975 1974 EncodedJSValue jsTestObjUnsignedLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1976 1975 { 1977 VM& vm = state->vm(); 1978 auto throwScope = DECLARE_THROW_SCOPE(vm); 1979 UNUSED_PARAM(throwScope); 1980 UNUSED_PARAM(thisValue); 1981 JSValue decodedThisValue = JSValue::decode(thisValue); 1982 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 1983 if (UNLIKELY(!castedThis)) { 1984 return throwGetterTypeError(*state, throwScope, "TestObject", "unsignedLongLongAttr"); 1985 } 1986 auto& impl = castedThis->wrapped(); 1976 return BindingCaller<JSTestObj>::attribute<jsTestObjUnsignedLongLongAttrGetter>(state, thisValue, "unsignedLongLongAttr"); 1977 } 1978 1979 static inline JSValue jsTestObjUnsignedLongLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1980 { 1981 UNUSED_PARAM(throwScope); 1982 UNUSED_PARAM(state); 1983 auto& impl = thisObject->wrapped(); 1987 1984 JSValue result = jsNumber(impl.unsignedLongLongAttr()); 1988 return JSValue::encode(result); 1989 } 1990 1985 return result; 1986 } 1987 1988 static inline JSValue jsTestObjStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 1991 1989 1992 1990 EncodedJSValue jsTestObjStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 1993 1991 { 1994 VM& vm = state->vm(); 1995 auto throwScope = DECLARE_THROW_SCOPE(vm); 1996 UNUSED_PARAM(throwScope); 1997 UNUSED_PARAM(thisValue); 1998 JSValue decodedThisValue = JSValue::decode(thisValue); 1999 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2000 if (UNLIKELY(!castedThis)) { 2001 return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttr"); 2002 } 2003 auto& impl = castedThis->wrapped(); 1992 return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrGetter>(state, thisValue, "stringAttr"); 1993 } 1994 1995 static inline JSValue jsTestObjStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 1996 { 1997 UNUSED_PARAM(throwScope); 1998 UNUSED_PARAM(state); 1999 auto& impl = thisObject->wrapped(); 2004 2000 JSValue result = jsStringWithCache(state, impl.stringAttr()); 2005 return JSValue::encode(result); 2006 } 2007 2001 return result; 2002 } 2003 2004 static inline JSValue jsTestObjUsvstringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2008 2005 2009 2006 EncodedJSValue jsTestObjUsvstringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2010 2007 { 2011 VM& vm = state->vm(); 2012 auto throwScope = DECLARE_THROW_SCOPE(vm); 2013 UNUSED_PARAM(throwScope); 2014 UNUSED_PARAM(thisValue); 2015 JSValue decodedThisValue = JSValue::decode(thisValue); 2016 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2017 if (UNLIKELY(!castedThis)) { 2018 return throwGetterTypeError(*state, throwScope, "TestObject", "usvstringAttr"); 2019 } 2020 auto& impl = castedThis->wrapped(); 2008 return BindingCaller<JSTestObj>::attribute<jsTestObjUsvstringAttrGetter>(state, thisValue, "usvstringAttr"); 2009 } 2010 2011 static inline JSValue jsTestObjUsvstringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2012 { 2013 UNUSED_PARAM(throwScope); 2014 UNUSED_PARAM(state); 2015 auto& impl = thisObject->wrapped(); 2021 2016 JSValue result = jsStringWithCache(state, impl.usvstringAttr()); 2022 return JSValue::encode(result); 2023 } 2024 2017 return result; 2018 } 2019 2020 static inline JSValue jsTestObjTestObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2025 2021 2026 2022 EncodedJSValue jsTestObjTestObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2027 2023 { 2028 VM& vm = state->vm(); 2029 auto throwScope = DECLARE_THROW_SCOPE(vm); 2030 UNUSED_PARAM(throwScope); 2031 UNUSED_PARAM(thisValue); 2032 JSValue decodedThisValue = JSValue::decode(thisValue); 2033 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2034 if (UNLIKELY(!castedThis)) { 2035 return throwGetterTypeError(*state, throwScope, "TestObject", "testObjAttr"); 2036 } 2037 auto& impl = castedThis->wrapped(); 2038 JSValue result = toJS(state, castedThis->globalObject(), impl.testObjAttr()); 2039 return JSValue::encode(result); 2040 } 2041 2024 return BindingCaller<JSTestObj>::attribute<jsTestObjTestObjAttrGetter>(state, thisValue, "testObjAttr"); 2025 } 2026 2027 static inline JSValue jsTestObjTestObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2028 { 2029 UNUSED_PARAM(throwScope); 2030 UNUSED_PARAM(state); 2031 auto& impl = thisObject->wrapped(); 2032 JSValue result = toJS(state, thisObject->globalObject(), impl.testObjAttr()); 2033 return result; 2034 } 2035 2036 static inline JSValue jsTestObjTestNullableObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2042 2037 2043 2038 EncodedJSValue jsTestObjTestNullableObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2044 2039 { 2045 VM& vm = state->vm(); 2046 auto throwScope = DECLARE_THROW_SCOPE(vm); 2047 UNUSED_PARAM(throwScope); 2048 UNUSED_PARAM(thisValue); 2049 JSValue decodedThisValue = JSValue::decode(thisValue); 2050 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2051 if (UNLIKELY(!castedThis)) { 2052 return throwGetterTypeError(*state, throwScope, "TestObject", "testNullableObjAttr"); 2053 } 2054 auto& impl = castedThis->wrapped(); 2055 JSValue result = toJS(state, castedThis->globalObject(), impl.testNullableObjAttr()); 2056 return JSValue::encode(result); 2057 } 2058 2040 return BindingCaller<JSTestObj>::attribute<jsTestObjTestNullableObjAttrGetter>(state, thisValue, "testNullableObjAttr"); 2041 } 2042 2043 static inline JSValue jsTestObjTestNullableObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2044 { 2045 UNUSED_PARAM(throwScope); 2046 UNUSED_PARAM(state); 2047 auto& impl = thisObject->wrapped(); 2048 JSValue result = toJS(state, thisObject->globalObject(), impl.testNullableObjAttr()); 2049 return result; 2050 } 2051 2052 static inline JSValue jsTestObjLenientTestObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2059 2053 2060 2054 EncodedJSValue jsTestObjLenientTestObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2061 2055 { 2062 VM& vm = state->vm(); 2063 auto throwScope = DECLARE_THROW_SCOPE(vm); 2064 UNUSED_PARAM(throwScope); 2065 UNUSED_PARAM(thisValue); 2066 JSValue decodedThisValue = JSValue::decode(thisValue); 2067 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2068 if (UNLIKELY(!castedThis)) { 2069 return JSValue::encode(jsUndefined()); 2070 } 2071 auto& impl = castedThis->wrapped(); 2072 JSValue result = toJS(state, castedThis->globalObject(), impl.lenientTestObjAttr()); 2073 return JSValue::encode(result); 2074 } 2075 2056 return BindingCaller<JSTestObj>::attribute<jsTestObjLenientTestObjAttrGetter, CastedThisErrorBehavior::ReturnEarly>(state, thisValue, "lenientTestObjAttr"); 2057 } 2058 2059 static inline JSValue jsTestObjLenientTestObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2060 { 2061 UNUSED_PARAM(throwScope); 2062 UNUSED_PARAM(state); 2063 auto& impl = thisObject->wrapped(); 2064 JSValue result = toJS(state, thisObject->globalObject(), impl.lenientTestObjAttr()); 2065 return result; 2066 } 2067 2068 static inline JSValue jsTestObjUnforgeableAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2076 2069 2077 2070 EncodedJSValue jsTestObjUnforgeableAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2078 2071 { 2079 VM& vm = state->vm(); 2080 auto throwScope = DECLARE_THROW_SCOPE(vm); 2081 UNUSED_PARAM(throwScope); 2082 UNUSED_PARAM(thisValue); 2083 JSValue decodedThisValue = JSValue::decode(thisValue); 2084 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2085 if (UNLIKELY(!castedThis)) { 2086 return throwGetterTypeError(*state, throwScope, "TestObject", "unforgeableAttr"); 2087 } 2088 auto& impl = castedThis->wrapped(); 2072 return BindingCaller<JSTestObj>::attribute<jsTestObjUnforgeableAttrGetter>(state, thisValue, "unforgeableAttr"); 2073 } 2074 2075 static inline JSValue jsTestObjUnforgeableAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2076 { 2077 UNUSED_PARAM(throwScope); 2078 UNUSED_PARAM(state); 2079 auto& impl = thisObject->wrapped(); 2089 2080 JSValue result = jsStringWithCache(state, impl.unforgeableAttr()); 2090 return JSValue::encode(result); 2091 } 2092 2081 return result; 2082 } 2083 2084 static inline JSValue jsTestObjStringAttrTreatingNullAsEmptyStringGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2093 2085 2094 2086 EncodedJSValue jsTestObjStringAttrTreatingNullAsEmptyString(ExecState* state, EncodedJSValue thisValue, PropertyName) 2095 2087 { 2096 VM& vm = state->vm(); 2097 auto throwScope = DECLARE_THROW_SCOPE(vm); 2098 UNUSED_PARAM(throwScope); 2099 UNUSED_PARAM(thisValue); 2100 JSValue decodedThisValue = JSValue::decode(thisValue); 2101 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2102 if (UNLIKELY(!castedThis)) { 2103 return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttrTreatingNullAsEmptyString"); 2104 } 2105 auto& impl = castedThis->wrapped(); 2088 return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrTreatingNullAsEmptyStringGetter>(state, thisValue, "stringAttrTreatingNullAsEmptyString"); 2089 } 2090 2091 static inline JSValue jsTestObjStringAttrTreatingNullAsEmptyStringGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2092 { 2093 UNUSED_PARAM(throwScope); 2094 UNUSED_PARAM(state); 2095 auto& impl = thisObject->wrapped(); 2106 2096 JSValue result = jsStringWithCache(state, impl.stringAttrTreatingNullAsEmptyString()); 2107 return JSValue::encode(result); 2108 } 2109 2097 return result; 2098 } 2099 2100 static inline JSValue jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2110 2101 2111 2102 EncodedJSValue jsTestObjUsvstringAttrTreatingNullAsEmptyString(ExecState* state, EncodedJSValue thisValue, PropertyName) 2112 2103 { 2113 VM& vm = state->vm(); 2114 auto throwScope = DECLARE_THROW_SCOPE(vm); 2115 UNUSED_PARAM(throwScope); 2116 UNUSED_PARAM(thisValue); 2117 JSValue decodedThisValue = JSValue::decode(thisValue); 2118 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2119 if (UNLIKELY(!castedThis)) { 2120 return throwGetterTypeError(*state, throwScope, "TestObject", "usvstringAttrTreatingNullAsEmptyString"); 2121 } 2122 auto& impl = castedThis->wrapped(); 2104 return BindingCaller<JSTestObj>::attribute<jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter>(state, thisValue, "usvstringAttrTreatingNullAsEmptyString"); 2105 } 2106 2107 static inline JSValue jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2108 { 2109 UNUSED_PARAM(throwScope); 2110 UNUSED_PARAM(state); 2111 auto& impl = thisObject->wrapped(); 2123 2112 JSValue result = jsStringWithCache(state, impl.usvstringAttrTreatingNullAsEmptyString()); 2124 return JSValue::encode(result); 2125 } 2126 2113 return result; 2114 } 2115 2116 static inline JSValue jsTestObjImplementationEnumAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2127 2117 2128 2118 EncodedJSValue jsTestObjImplementationEnumAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2129 2119 { 2130 VM& vm = state->vm(); 2131 auto throwScope = DECLARE_THROW_SCOPE(vm); 2132 UNUSED_PARAM(throwScope); 2133 UNUSED_PARAM(thisValue); 2134 JSValue decodedThisValue = JSValue::decode(thisValue); 2135 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2136 if (UNLIKELY(!castedThis)) { 2137 return throwGetterTypeError(*state, throwScope, "TestObject", "implementationEnumAttr"); 2138 } 2139 auto& impl = castedThis->wrapped(); 2120 return BindingCaller<JSTestObj>::attribute<jsTestObjImplementationEnumAttrGetter>(state, thisValue, "implementationEnumAttr"); 2121 } 2122 2123 static inline JSValue jsTestObjImplementationEnumAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2124 { 2125 UNUSED_PARAM(throwScope); 2126 UNUSED_PARAM(state); 2127 auto& impl = thisObject->wrapped(); 2140 2128 JSValue result = jsStringWithCache(state, impl.implementationEnumAttr()); 2141 return JSValue::encode(result); 2142 } 2143 2129 return result; 2130 } 2131 2132 static inline JSValue jsTestObjXMLObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2144 2133 2145 2134 EncodedJSValue jsTestObjXMLObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2146 2135 { 2147 VM& vm = state->vm(); 2148 auto throwScope = DECLARE_THROW_SCOPE(vm); 2149 UNUSED_PARAM(throwScope); 2150 UNUSED_PARAM(thisValue); 2151 JSValue decodedThisValue = JSValue::decode(thisValue); 2152 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2153 if (UNLIKELY(!castedThis)) { 2154 return throwGetterTypeError(*state, throwScope, "TestObject", "XMLObjAttr"); 2155 } 2156 auto& impl = castedThis->wrapped(); 2157 JSValue result = toJS(state, castedThis->globalObject(), impl.xmlObjAttr()); 2158 return JSValue::encode(result); 2159 } 2160 2136 return BindingCaller<JSTestObj>::attribute<jsTestObjXMLObjAttrGetter>(state, thisValue, "XMLObjAttr"); 2137 } 2138 2139 static inline JSValue jsTestObjXMLObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2140 { 2141 UNUSED_PARAM(throwScope); 2142 UNUSED_PARAM(state); 2143 auto& impl = thisObject->wrapped(); 2144 JSValue result = toJS(state, thisObject->globalObject(), impl.xmlObjAttr()); 2145 return result; 2146 } 2147 2148 static inline JSValue jsTestObjCreateGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2161 2149 2162 2150 EncodedJSValue jsTestObjCreate(ExecState* state, EncodedJSValue thisValue, PropertyName) 2163 2151 { 2164 VM& vm = state->vm(); 2165 auto throwScope = DECLARE_THROW_SCOPE(vm); 2166 UNUSED_PARAM(throwScope); 2167 UNUSED_PARAM(thisValue); 2168 JSValue decodedThisValue = JSValue::decode(thisValue); 2169 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2170 if (UNLIKELY(!castedThis)) { 2171 return throwGetterTypeError(*state, throwScope, "TestObject", "create"); 2172 } 2173 auto& impl = castedThis->wrapped(); 2152 return BindingCaller<JSTestObj>::attribute<jsTestObjCreateGetter>(state, thisValue, "create"); 2153 } 2154 2155 static inline JSValue jsTestObjCreateGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2156 { 2157 UNUSED_PARAM(throwScope); 2158 UNUSED_PARAM(state); 2159 auto& impl = thisObject->wrapped(); 2174 2160 JSValue result = jsBoolean(impl.isCreate()); 2175 return JSValue::encode(result); 2176 } 2177 2161 return result; 2162 } 2163 2164 static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2178 2165 2179 2166 EncodedJSValue jsTestObjReflectedStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2180 2167 { 2181 VM& vm = state->vm(); 2182 auto throwScope = DECLARE_THROW_SCOPE(vm); 2183 UNUSED_PARAM(throwScope); 2184 UNUSED_PARAM(thisValue); 2185 JSValue decodedThisValue = JSValue::decode(thisValue); 2186 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2187 if (UNLIKELY(!castedThis)) { 2188 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedStringAttr"); 2189 } 2190 auto& impl = castedThis->wrapped(); 2168 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedStringAttrGetter>(state, thisValue, "reflectedStringAttr"); 2169 } 2170 2171 static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2172 { 2173 UNUSED_PARAM(throwScope); 2174 UNUSED_PARAM(state); 2175 auto& impl = thisObject->wrapped(); 2191 2176 JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::reflectedstringattrAttr)); 2192 return JSValue::encode(result); 2193 } 2194 2177 return result; 2178 } 2179 2180 static inline JSValue jsTestObjReflectedUSVStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2195 2181 2196 2182 EncodedJSValue jsTestObjReflectedUSVStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2197 2183 { 2198 VM& vm = state->vm(); 2199 auto throwScope = DECLARE_THROW_SCOPE(vm); 2200 UNUSED_PARAM(throwScope); 2201 UNUSED_PARAM(thisValue); 2202 JSValue decodedThisValue = JSValue::decode(thisValue); 2203 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2204 if (UNLIKELY(!castedThis)) { 2205 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedUSVStringAttr"); 2206 } 2207 auto& impl = castedThis->wrapped(); 2184 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedUSVStringAttrGetter>(state, thisValue, "reflectedUSVStringAttr"); 2185 } 2186 2187 static inline JSValue jsTestObjReflectedUSVStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2188 { 2189 UNUSED_PARAM(throwScope); 2190 UNUSED_PARAM(state); 2191 auto& impl = thisObject->wrapped(); 2208 2192 JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::reflectedusvstringattrAttr)); 2209 return JSValue::encode(result); 2210 } 2211 2193 return result; 2194 } 2195 2196 static inline JSValue jsTestObjReflectedIntegralAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2212 2197 2213 2198 EncodedJSValue jsTestObjReflectedIntegralAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2214 2199 { 2215 VM& vm = state->vm(); 2216 auto throwScope = DECLARE_THROW_SCOPE(vm); 2217 UNUSED_PARAM(throwScope); 2218 UNUSED_PARAM(thisValue); 2219 JSValue decodedThisValue = JSValue::decode(thisValue); 2220 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2221 if (UNLIKELY(!castedThis)) { 2222 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedIntegralAttr"); 2223 } 2224 auto& impl = castedThis->wrapped(); 2200 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedIntegralAttrGetter>(state, thisValue, "reflectedIntegralAttr"); 2201 } 2202 2203 static inline JSValue jsTestObjReflectedIntegralAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2204 { 2205 UNUSED_PARAM(throwScope); 2206 UNUSED_PARAM(state); 2207 auto& impl = thisObject->wrapped(); 2225 2208 JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr)); 2226 return JSValue::encode(result); 2227 } 2228 2209 return result; 2210 } 2211 2212 static inline JSValue jsTestObjReflectedUnsignedIntegralAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2229 2213 2230 2214 EncodedJSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2231 2215 { 2232 VM& vm = state->vm(); 2233 auto throwScope = DECLARE_THROW_SCOPE(vm); 2234 UNUSED_PARAM(throwScope); 2235 UNUSED_PARAM(thisValue); 2236 JSValue decodedThisValue = JSValue::decode(thisValue); 2237 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2238 if (UNLIKELY(!castedThis)) { 2239 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedUnsignedIntegralAttr"); 2240 } 2241 auto& impl = castedThis->wrapped(); 2216 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedUnsignedIntegralAttrGetter>(state, thisValue, "reflectedUnsignedIntegralAttr"); 2217 } 2218 2219 static inline JSValue jsTestObjReflectedUnsignedIntegralAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2220 { 2221 UNUSED_PARAM(throwScope); 2222 UNUSED_PARAM(state); 2223 auto& impl = thisObject->wrapped(); 2242 2224 JSValue result = jsNumber(std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr))); 2243 return JSValue::encode(result); 2244 } 2245 2225 return result; 2226 } 2227 2228 static inline JSValue jsTestObjReflectedBooleanAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2246 2229 2247 2230 EncodedJSValue jsTestObjReflectedBooleanAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2248 2231 { 2249 VM& vm = state->vm(); 2250 auto throwScope = DECLARE_THROW_SCOPE(vm); 2251 UNUSED_PARAM(throwScope); 2252 UNUSED_PARAM(thisValue); 2253 JSValue decodedThisValue = JSValue::decode(thisValue); 2254 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2255 if (UNLIKELY(!castedThis)) { 2256 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedBooleanAttr"); 2257 } 2258 auto& impl = castedThis->wrapped(); 2232 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedBooleanAttrGetter>(state, thisValue, "reflectedBooleanAttr"); 2233 } 2234 2235 static inline JSValue jsTestObjReflectedBooleanAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2236 { 2237 UNUSED_PARAM(throwScope); 2238 UNUSED_PARAM(state); 2239 auto& impl = thisObject->wrapped(); 2259 2240 JSValue result = jsBoolean(impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedbooleanattrAttr)); 2260 return JSValue::encode(result); 2261 } 2262 2241 return result; 2242 } 2243 2244 static inline JSValue jsTestObjReflectedURLAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2263 2245 2264 2246 EncodedJSValue jsTestObjReflectedURLAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2265 2247 { 2266 VM& vm = state->vm(); 2267 auto throwScope = DECLARE_THROW_SCOPE(vm); 2268 UNUSED_PARAM(throwScope); 2269 UNUSED_PARAM(thisValue); 2270 JSValue decodedThisValue = JSValue::decode(thisValue); 2271 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2272 if (UNLIKELY(!castedThis)) { 2273 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedURLAttr"); 2274 } 2275 auto& impl = castedThis->wrapped(); 2248 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedURLAttrGetter>(state, thisValue, "reflectedURLAttr"); 2249 } 2250 2251 static inline JSValue jsTestObjReflectedURLAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2252 { 2253 UNUSED_PARAM(throwScope); 2254 UNUSED_PARAM(state); 2255 auto& impl = thisObject->wrapped(); 2276 2256 JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)); 2277 return JSValue::encode(result); 2278 } 2279 2257 return result; 2258 } 2259 2260 static inline JSValue jsTestObjReflectedUSVURLAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2280 2261 2281 2262 EncodedJSValue jsTestObjReflectedUSVURLAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2282 2263 { 2283 VM& vm = state->vm(); 2284 auto throwScope = DECLARE_THROW_SCOPE(vm); 2285 UNUSED_PARAM(throwScope); 2286 UNUSED_PARAM(thisValue); 2287 JSValue decodedThisValue = JSValue::decode(thisValue); 2288 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2289 if (UNLIKELY(!castedThis)) { 2290 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedUSVURLAttr"); 2291 } 2292 auto& impl = castedThis->wrapped(); 2264 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedUSVURLAttrGetter>(state, thisValue, "reflectedUSVURLAttr"); 2265 } 2266 2267 static inline JSValue jsTestObjReflectedUSVURLAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2268 { 2269 UNUSED_PARAM(throwScope); 2270 UNUSED_PARAM(state); 2271 auto& impl = thisObject->wrapped(); 2293 2272 JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::reflectedusvurlattrAttr)); 2294 return JSValue::encode(result); 2295 } 2296 2273 return result; 2274 } 2275 2276 static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2297 2277 2298 2278 EncodedJSValue jsTestObjReflectedStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2299 2279 { 2300 VM& vm = state->vm(); 2301 auto throwScope = DECLARE_THROW_SCOPE(vm); 2302 UNUSED_PARAM(throwScope); 2303 UNUSED_PARAM(thisValue); 2304 JSValue decodedThisValue = JSValue::decode(thisValue); 2305 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2306 if (UNLIKELY(!castedThis)) { 2307 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedStringAttr"); 2308 } 2309 auto& impl = castedThis->wrapped(); 2280 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedStringAttrGetter>(state, thisValue, "reflectedStringAttr"); 2281 } 2282 2283 static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2284 { 2285 UNUSED_PARAM(throwScope); 2286 UNUSED_PARAM(state); 2287 auto& impl = thisObject->wrapped(); 2310 2288 JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::customContentStringAttrAttr)); 2311 return JSValue::encode(result); 2312 } 2313 2289 return result; 2290 } 2291 2292 static inline JSValue jsTestObjReflectedCustomIntegralAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2314 2293 2315 2294 EncodedJSValue jsTestObjReflectedCustomIntegralAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2316 2295 { 2317 VM& vm = state->vm(); 2318 auto throwScope = DECLARE_THROW_SCOPE(vm); 2319 UNUSED_PARAM(throwScope); 2320 UNUSED_PARAM(thisValue); 2321 JSValue decodedThisValue = JSValue::decode(thisValue); 2322 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2323 if (UNLIKELY(!castedThis)) { 2324 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedCustomIntegralAttr"); 2325 } 2326 auto& impl = castedThis->wrapped(); 2296 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedCustomIntegralAttrGetter>(state, thisValue, "reflectedCustomIntegralAttr"); 2297 } 2298 2299 static inline JSValue jsTestObjReflectedCustomIntegralAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2300 { 2301 UNUSED_PARAM(throwScope); 2302 UNUSED_PARAM(state); 2303 auto& impl = thisObject->wrapped(); 2327 2304 JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr)); 2328 return JSValue::encode(result); 2329 } 2330 2305 return result; 2306 } 2307 2308 static inline JSValue jsTestObjReflectedCustomBooleanAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2331 2309 2332 2310 EncodedJSValue jsTestObjReflectedCustomBooleanAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2333 2311 { 2334 VM& vm = state->vm(); 2335 auto throwScope = DECLARE_THROW_SCOPE(vm); 2336 UNUSED_PARAM(throwScope); 2337 UNUSED_PARAM(thisValue); 2338 JSValue decodedThisValue = JSValue::decode(thisValue); 2339 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2340 if (UNLIKELY(!castedThis)) { 2341 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedCustomBooleanAttr"); 2342 } 2343 auto& impl = castedThis->wrapped(); 2312 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedCustomBooleanAttrGetter>(state, thisValue, "reflectedCustomBooleanAttr"); 2313 } 2314 2315 static inline JSValue jsTestObjReflectedCustomBooleanAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2316 { 2317 UNUSED_PARAM(throwScope); 2318 UNUSED_PARAM(state); 2319 auto& impl = thisObject->wrapped(); 2344 2320 JSValue result = jsBoolean(impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::customContentBooleanAttrAttr)); 2345 return JSValue::encode(result); 2346 } 2347 2321 return result; 2322 } 2323 2324 static inline JSValue jsTestObjReflectedCustomURLAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2348 2325 2349 2326 EncodedJSValue jsTestObjReflectedCustomURLAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2350 2327 { 2351 VM& vm = state->vm(); 2352 auto throwScope = DECLARE_THROW_SCOPE(vm); 2353 UNUSED_PARAM(throwScope); 2354 UNUSED_PARAM(thisValue); 2355 JSValue decodedThisValue = JSValue::decode(thisValue); 2356 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2357 if (UNLIKELY(!castedThis)) { 2358 return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedCustomURLAttr"); 2359 } 2360 auto& impl = castedThis->wrapped(); 2328 return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedCustomURLAttrGetter>(state, thisValue, "reflectedCustomURLAttr"); 2329 } 2330 2331 static inline JSValue jsTestObjReflectedCustomURLAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2332 { 2333 UNUSED_PARAM(throwScope); 2334 UNUSED_PARAM(state); 2335 auto& impl = thisObject->wrapped(); 2361 2336 JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)); 2362 return JSValue::encode(result); 2363 } 2364 2337 return result; 2338 } 2365 2339 2366 2340 #if ENABLE(TEST_FEATURE) 2341 static inline JSValue jsTestObjEnabledAtRuntimeAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2342 2367 2343 EncodedJSValue jsTestObjEnabledAtRuntimeAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2368 2344 { 2369 VM& vm = state->vm(); 2370 auto throwScope = DECLARE_THROW_SCOPE(vm); 2371 UNUSED_PARAM(throwScope); 2372 UNUSED_PARAM(thisValue); 2373 JSValue decodedThisValue = JSValue::decode(thisValue); 2374 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2375 if (UNLIKELY(!castedThis)) { 2376 return throwGetterTypeError(*state, throwScope, "TestObject", "enabledAtRuntimeAttribute"); 2377 } 2378 auto& impl = castedThis->wrapped(); 2345 return BindingCaller<JSTestObj>::attribute<jsTestObjEnabledAtRuntimeAttributeGetter>(state, thisValue, "enabledAtRuntimeAttribute"); 2346 } 2347 2348 static inline JSValue jsTestObjEnabledAtRuntimeAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2349 { 2350 UNUSED_PARAM(throwScope); 2351 UNUSED_PARAM(state); 2352 auto& impl = thisObject->wrapped(); 2379 2353 JSValue result = jsStringWithCache(state, impl.enabledAtRuntimeAttribute()); 2380 return JSValue::encode(result); 2381 } 2382 2383 #endif 2354 return result; 2355 } 2356 2357 #endif 2358 2359 static inline JSValue jsTestObjTypedArrayAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2384 2360 2385 2361 EncodedJSValue jsTestObjTypedArrayAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2386 2362 { 2387 VM& vm = state->vm(); 2388 auto throwScope = DECLARE_THROW_SCOPE(vm); 2389 UNUSED_PARAM(throwScope); 2390 UNUSED_PARAM(thisValue); 2391 JSValue decodedThisValue = JSValue::decode(thisValue); 2392 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2393 if (UNLIKELY(!castedThis)) { 2394 return throwGetterTypeError(*state, throwScope, "TestObject", "typedArrayAttr"); 2395 } 2396 auto& impl = castedThis->wrapped(); 2397 JSValue result = toJS(state, castedThis->globalObject(), impl.typedArrayAttr()); 2398 return JSValue::encode(result); 2399 } 2400 2363 return BindingCaller<JSTestObj>::attribute<jsTestObjTypedArrayAttrGetter>(state, thisValue, "typedArrayAttr"); 2364 } 2365 2366 static inline JSValue jsTestObjTypedArrayAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2367 { 2368 UNUSED_PARAM(throwScope); 2369 UNUSED_PARAM(state); 2370 auto& impl = thisObject->wrapped(); 2371 JSValue result = toJS(state, thisObject->globalObject(), impl.typedArrayAttr()); 2372 return result; 2373 } 2374 2375 static inline JSValue jsTestObjAttrWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2401 2376 2402 2377 EncodedJSValue jsTestObjAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 2403 2378 { 2404 VM& vm = state->vm(); 2405 auto throwScope = DECLARE_THROW_SCOPE(vm); 2406 UNUSED_PARAM(throwScope); 2407 UNUSED_PARAM(thisValue); 2408 JSValue decodedThisValue = JSValue::decode(thisValue); 2409 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2410 if (UNLIKELY(!castedThis)) { 2411 return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithGetterException"); 2412 } 2379 return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithGetterExceptionGetter>(state, thisValue, "attrWithGetterException"); 2380 } 2381 2382 static inline JSValue jsTestObjAttrWithGetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2383 { 2384 UNUSED_PARAM(throwScope); 2385 UNUSED_PARAM(state); 2413 2386 ExceptionCode ec = 0; 2414 auto& impl = castedThis->wrapped();2387 auto& impl = thisObject->wrapped(); 2415 2388 JSValue result = jsNumber(impl.attrWithGetterException(ec)); 2416 2389 setDOMException(state, throwScope, ec); 2417 return JSValue::encode(result); 2418 } 2419 2390 return result; 2391 } 2392 2393 static inline JSValue jsTestObjAttrWithGetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2420 2394 2421 2395 EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName) 2422 2396 { 2423 VM& vm = state->vm(); 2424 auto throwScope = DECLARE_THROW_SCOPE(vm); 2425 UNUSED_PARAM(throwScope); 2426 UNUSED_PARAM(thisValue); 2427 JSValue decodedThisValue = JSValue::decode(thisValue); 2428 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2429 if (UNLIKELY(!castedThis)) { 2430 return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithGetterExceptionWithMessage"); 2431 } 2397 return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithGetterExceptionWithMessageGetter>(state, thisValue, "attrWithGetterExceptionWithMessage"); 2398 } 2399 2400 static inline JSValue jsTestObjAttrWithGetterExceptionWithMessageGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2401 { 2402 UNUSED_PARAM(throwScope); 2403 UNUSED_PARAM(state); 2432 2404 ExceptionCodeWithMessage ec; 2433 auto& impl = castedThis->wrapped();2405 auto& impl = thisObject->wrapped(); 2434 2406 JSValue result = jsNumber(impl.attrWithGetterExceptionWithMessage(ec)); 2435 2407 setDOMException(state, throwScope, ec); 2436 return JSValue::encode(result); 2437 } 2438 2408 return result; 2409 } 2410 2411 static inline JSValue jsTestObjAttrWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2439 2412 2440 2413 EncodedJSValue jsTestObjAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 2441 2414 { 2442 VM& vm = state->vm(); 2443 auto throwScope = DECLARE_THROW_SCOPE(vm); 2444 UNUSED_PARAM(throwScope); 2445 UNUSED_PARAM(thisValue); 2446 JSValue decodedThisValue = JSValue::decode(thisValue); 2447 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2448 if (UNLIKELY(!castedThis)) { 2449 return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithSetterException"); 2450 } 2451 auto& impl = castedThis->wrapped(); 2415 return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithSetterExceptionGetter>(state, thisValue, "attrWithSetterException"); 2416 } 2417 2418 static inline JSValue jsTestObjAttrWithSetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2419 { 2420 UNUSED_PARAM(throwScope); 2421 UNUSED_PARAM(state); 2422 auto& impl = thisObject->wrapped(); 2452 2423 JSValue result = jsNumber(impl.attrWithSetterException()); 2453 return JSValue::encode(result); 2454 } 2455 2424 return result; 2425 } 2426 2427 static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2456 2428 2457 2429 EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName) 2458 2430 { 2459 VM& vm = state->vm(); 2460 auto throwScope = DECLARE_THROW_SCOPE(vm); 2461 UNUSED_PARAM(throwScope); 2462 UNUSED_PARAM(thisValue); 2463 JSValue decodedThisValue = JSValue::decode(thisValue); 2464 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2465 if (UNLIKELY(!castedThis)) { 2466 return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithSetterExceptionWithMessage"); 2467 } 2468 auto& impl = castedThis->wrapped(); 2431 return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithSetterExceptionWithMessageGetter>(state, thisValue, "attrWithSetterExceptionWithMessage"); 2432 } 2433 2434 static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2435 { 2436 UNUSED_PARAM(throwScope); 2437 UNUSED_PARAM(state); 2438 auto& impl = thisObject->wrapped(); 2469 2439 JSValue result = jsNumber(impl.attrWithSetterExceptionWithMessage()); 2470 return JSValue::encode(result); 2471 } 2472 2440 return result; 2441 } 2442 2443 static inline JSValue jsTestObjStringAttrWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2473 2444 2474 2445 EncodedJSValue jsTestObjStringAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 2475 2446 { 2476 VM& vm = state->vm(); 2477 auto throwScope = DECLARE_THROW_SCOPE(vm); 2478 UNUSED_PARAM(throwScope); 2479 UNUSED_PARAM(thisValue); 2480 JSValue decodedThisValue = JSValue::decode(thisValue); 2481 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2482 if (UNLIKELY(!castedThis)) { 2483 return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttrWithGetterException"); 2484 } 2447 return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrWithGetterExceptionGetter>(state, thisValue, "stringAttrWithGetterException"); 2448 } 2449 2450 static inline JSValue jsTestObjStringAttrWithGetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2451 { 2452 UNUSED_PARAM(throwScope); 2453 UNUSED_PARAM(state); 2485 2454 ExceptionCode ec = 0; 2486 auto& impl = castedThis->wrapped();2455 auto& impl = thisObject->wrapped(); 2487 2456 JSValue result = jsStringWithCache(state, impl.stringAttrWithGetterException(ec)); 2488 2457 setDOMException(state, throwScope, ec); 2489 return JSValue::encode(result); 2490 } 2491 2458 return result; 2459 } 2460 2461 static inline JSValue jsTestObjStringAttrWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2492 2462 2493 2463 EncodedJSValue jsTestObjStringAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 2494 2464 { 2495 VM& vm = state->vm(); 2496 auto throwScope = DECLARE_THROW_SCOPE(vm); 2497 UNUSED_PARAM(throwScope); 2498 UNUSED_PARAM(thisValue); 2499 JSValue decodedThisValue = JSValue::decode(thisValue); 2500 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2501 if (UNLIKELY(!castedThis)) { 2502 return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttrWithSetterException"); 2503 } 2504 auto& impl = castedThis->wrapped(); 2465 return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrWithSetterExceptionGetter>(state, thisValue, "stringAttrWithSetterException"); 2466 } 2467 2468 static inline JSValue jsTestObjStringAttrWithSetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2469 { 2470 UNUSED_PARAM(throwScope); 2471 UNUSED_PARAM(state); 2472 auto& impl = thisObject->wrapped(); 2505 2473 JSValue result = jsStringWithCache(state, impl.stringAttrWithSetterException()); 2506 return JSValue::encode(result); 2507 } 2508 2474 return result; 2475 } 2476 2477 static inline JSValue jsTestObjCustomAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2509 2478 2510 2479 EncodedJSValue jsTestObjCustomAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 2511 2480 { 2512 VM& vm = state->vm(); 2513 auto throwScope = DECLARE_THROW_SCOPE(vm); 2514 UNUSED_PARAM(throwScope); 2515 UNUSED_PARAM(thisValue); 2516 JSValue decodedThisValue = JSValue::decode(thisValue); 2517 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2518 if (UNLIKELY(!castedThis)) { 2519 return throwGetterTypeError(*state, throwScope, "TestObject", "customAttr"); 2520 } 2521 return JSValue::encode(castedThis->customAttr(*state)); 2522 } 2523 2481 return BindingCaller<JSTestObj>::attribute<jsTestObjCustomAttrGetter>(state, thisValue, "customAttr"); 2482 } 2483 2484 static inline JSValue jsTestObjCustomAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2485 { 2486 UNUSED_PARAM(throwScope); 2487 UNUSED_PARAM(state); 2488 return thisObject->customAttr(*state); 2489 } 2490 2491 static inline JSValue jsTestObjOnfooGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2524 2492 2525 2493 EncodedJSValue jsTestObjOnfoo(ExecState* state, EncodedJSValue thisValue, PropertyName) 2526 2494 { 2527 VM& vm = state->vm(); 2528 auto throwScope = DECLARE_THROW_SCOPE(vm); 2529 UNUSED_PARAM(throwScope); 2530 UNUSED_PARAM(thisValue); 2531 JSValue decodedThisValue = JSValue::decode(thisValue); 2532 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2533 if (UNLIKELY(!castedThis)) { 2534 return throwGetterTypeError(*state, throwScope, "TestObject", "onfoo"); 2535 } 2536 UNUSED_PARAM(state); 2537 return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().fooEvent)); 2538 } 2539 2495 return BindingCaller<JSTestObj>::attribute<jsTestObjOnfooGetter>(state, thisValue, "onfoo"); 2496 } 2497 2498 static inline JSValue jsTestObjOnfooGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2499 { 2500 UNUSED_PARAM(throwScope); 2501 UNUSED_PARAM(state); 2502 return eventHandlerAttribute(thisObject->wrapped(), eventNames().fooEvent); 2503 } 2504 2505 static inline JSValue jsTestObjOnwebkitfooGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2540 2506 2541 2507 EncodedJSValue jsTestObjOnwebkitfoo(ExecState* state, EncodedJSValue thisValue, PropertyName) 2542 2508 { 2543 VM& vm = state->vm(); 2544 auto throwScope = DECLARE_THROW_SCOPE(vm); 2545 UNUSED_PARAM(throwScope); 2546 UNUSED_PARAM(thisValue); 2547 JSValue decodedThisValue = JSValue::decode(thisValue); 2548 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2549 if (UNLIKELY(!castedThis)) { 2550 return throwGetterTypeError(*state, throwScope, "TestObject", "onwebkitfoo"); 2551 } 2552 UNUSED_PARAM(state); 2553 return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().fooEvent)); 2554 } 2555 2509 return BindingCaller<JSTestObj>::attribute<jsTestObjOnwebkitfooGetter>(state, thisValue, "onwebkitfoo"); 2510 } 2511 2512 static inline JSValue jsTestObjOnwebkitfooGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2513 { 2514 UNUSED_PARAM(throwScope); 2515 UNUSED_PARAM(state); 2516 return eventHandlerAttribute(thisObject->wrapped(), eventNames().fooEvent); 2517 } 2518 2519 static inline JSValue jsTestObjWithScriptStateAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2556 2520 2557 2521 EncodedJSValue jsTestObjWithScriptStateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2558 2522 { 2559 VM& vm = state->vm(); 2560 auto throwScope = DECLARE_THROW_SCOPE(vm); 2561 UNUSED_PARAM(throwScope); 2562 UNUSED_PARAM(thisValue); 2563 JSValue decodedThisValue = JSValue::decode(thisValue); 2564 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2565 if (UNLIKELY(!castedThis)) { 2566 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptStateAttribute"); 2567 } 2568 auto& impl = castedThis->wrapped(); 2523 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptStateAttributeGetter>(state, thisValue, "withScriptStateAttribute"); 2524 } 2525 2526 static inline JSValue jsTestObjWithScriptStateAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2527 { 2528 UNUSED_PARAM(throwScope); 2529 UNUSED_PARAM(state); 2530 auto& impl = thisObject->wrapped(); 2569 2531 JSValue result = jsNumber(impl.withScriptStateAttribute(*state)); 2570 return JSValue::encode(result); 2571 } 2572 2532 return result; 2533 } 2534 2535 static inline JSValue jsTestObjWithCallWithAndSetterCallWithAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2573 2536 2574 2537 EncodedJSValue jsTestObjWithCallWithAndSetterCallWithAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2575 2538 { 2576 VM& vm = state->vm(); 2577 auto throwScope = DECLARE_THROW_SCOPE(vm); 2578 UNUSED_PARAM(throwScope); 2579 UNUSED_PARAM(thisValue); 2580 JSValue decodedThisValue = JSValue::decode(thisValue); 2581 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2582 if (UNLIKELY(!castedThis)) { 2583 return throwGetterTypeError(*state, throwScope, "TestObject", "withCallWithAndSetterCallWithAttribute"); 2584 } 2585 auto& impl = castedThis->wrapped(); 2539 return BindingCaller<JSTestObj>::attribute<jsTestObjWithCallWithAndSetterCallWithAttributeGetter>(state, thisValue, "withCallWithAndSetterCallWithAttribute"); 2540 } 2541 2542 static inline JSValue jsTestObjWithCallWithAndSetterCallWithAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2543 { 2544 UNUSED_PARAM(throwScope); 2545 UNUSED_PARAM(state); 2546 auto& impl = thisObject->wrapped(); 2586 2547 JSValue result = jsNumber(impl.withCallWithAndSetterCallWithAttribute(*state)); 2587 return JSValue::encode(result); 2588 } 2589 2548 return result; 2549 } 2550 2551 static inline JSValue jsTestObjWithScriptExecutionContextAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2590 2552 2591 2553 EncodedJSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2592 2554 { 2593 VM& vm = state->vm(); 2594 auto throwScope = DECLARE_THROW_SCOPE(vm); 2595 UNUSED_PARAM(throwScope); 2596 UNUSED_PARAM(thisValue); 2597 JSValue decodedThisValue = JSValue::decode(thisValue); 2598 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2599 if (UNLIKELY(!castedThis)) { 2600 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAttribute"); 2601 } 2555 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAttributeGetter>(state, thisValue, "withScriptExecutionContextAttribute"); 2556 } 2557 2558 static inline JSValue jsTestObjWithScriptExecutionContextAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2559 { 2560 UNUSED_PARAM(throwScope); 2561 UNUSED_PARAM(state); 2602 2562 auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 2603 2563 if (!context) 2604 return JSValue::encode(jsUndefined()); 2605 auto& impl = castedThis->wrapped(); 2606 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAttribute(*context)); 2607 return JSValue::encode(result); 2608 } 2609 2564 return jsUndefined(); 2565 auto& impl = thisObject->wrapped(); 2566 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAttribute(*context)); 2567 return result; 2568 } 2569 2570 static inline JSValue jsTestObjWithScriptStateAttributeRaisesGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2610 2571 2611 2572 EncodedJSValue jsTestObjWithScriptStateAttributeRaises(ExecState* state, EncodedJSValue thisValue, PropertyName) 2612 2573 { 2613 VM& vm = state->vm(); 2614 auto throwScope = DECLARE_THROW_SCOPE(vm); 2615 UNUSED_PARAM(throwScope); 2616 UNUSED_PARAM(thisValue); 2617 JSValue decodedThisValue = JSValue::decode(thisValue); 2618 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2619 if (UNLIKELY(!castedThis)) { 2620 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptStateAttributeRaises"); 2621 } 2574 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptStateAttributeRaisesGetter>(state, thisValue, "withScriptStateAttributeRaises"); 2575 } 2576 2577 static inline JSValue jsTestObjWithScriptStateAttributeRaisesGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2578 { 2579 UNUSED_PARAM(throwScope); 2580 UNUSED_PARAM(state); 2622 2581 ExceptionCode ec = 0; 2623 auto& impl = castedThis->wrapped();2624 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptStateAttributeRaises(*state, ec));2582 auto& impl = thisObject->wrapped(); 2583 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptStateAttributeRaises(*state, ec)); 2625 2584 setDOMException(state, throwScope, ec); 2626 return JSValue::encode(result); 2627 } 2628 2585 return result; 2586 } 2587 2588 static inline JSValue jsTestObjWithScriptExecutionContextAttributeRaisesGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2629 2589 2630 2590 EncodedJSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* state, EncodedJSValue thisValue, PropertyName) 2631 2591 { 2632 VM& vm = state->vm(); 2633 auto throwScope = DECLARE_THROW_SCOPE(vm); 2634 UNUSED_PARAM(throwScope); 2635 UNUSED_PARAM(thisValue); 2636 JSValue decodedThisValue = JSValue::decode(thisValue); 2637 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2638 if (UNLIKELY(!castedThis)) { 2639 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAttributeRaises"); 2640 } 2592 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAttributeRaisesGetter>(state, thisValue, "withScriptExecutionContextAttributeRaises"); 2593 } 2594 2595 static inline JSValue jsTestObjWithScriptExecutionContextAttributeRaisesGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2596 { 2597 UNUSED_PARAM(throwScope); 2598 UNUSED_PARAM(state); 2641 2599 ExceptionCode ec = 0; 2642 2600 auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 2643 2601 if (!context) 2644 return JSValue::encode(jsUndefined());2645 auto& impl = castedThis->wrapped();2646 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAttributeRaises(*context, ec));2602 return jsUndefined(); 2603 auto& impl = thisObject->wrapped(); 2604 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAttributeRaises(*context, ec)); 2647 2605 setDOMException(state, throwScope, ec); 2648 return JSValue::encode(result); 2649 } 2650 2606 return result; 2607 } 2608 2609 static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2651 2610 2652 2611 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2653 2612 { 2654 VM& vm = state->vm(); 2655 auto throwScope = DECLARE_THROW_SCOPE(vm); 2656 UNUSED_PARAM(throwScope); 2657 UNUSED_PARAM(thisValue); 2658 JSValue decodedThisValue = JSValue::decode(thisValue); 2659 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2660 if (UNLIKELY(!castedThis)) { 2661 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttribute"); 2662 } 2613 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter>(state, thisValue, "withScriptExecutionContextAndScriptStateAttribute"); 2614 } 2615 2616 static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2617 { 2618 UNUSED_PARAM(throwScope); 2619 UNUSED_PARAM(state); 2663 2620 auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 2664 2621 if (!context) 2665 return JSValue::encode(jsUndefined()); 2666 auto& impl = castedThis->wrapped(); 2667 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(*state, *context)); 2668 return JSValue::encode(result); 2669 } 2670 2622 return jsUndefined(); 2623 auto& impl = thisObject->wrapped(); 2624 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(*state, *context)); 2625 return result; 2626 } 2627 2628 static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaisesGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2671 2629 2672 2630 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* state, EncodedJSValue thisValue, PropertyName) 2673 2631 { 2674 VM& vm = state->vm(); 2675 auto throwScope = DECLARE_THROW_SCOPE(vm); 2676 UNUSED_PARAM(throwScope); 2677 UNUSED_PARAM(thisValue); 2678 JSValue decodedThisValue = JSValue::decode(thisValue); 2679 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2680 if (UNLIKELY(!castedThis)) { 2681 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttributeRaises"); 2682 } 2632 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaisesGetter>(state, thisValue, "withScriptExecutionContextAndScriptStateAttributeRaises"); 2633 } 2634 2635 static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaisesGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2636 { 2637 UNUSED_PARAM(throwScope); 2638 UNUSED_PARAM(state); 2683 2639 ExceptionCode ec = 0; 2684 2640 auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 2685 2641 if (!context) 2686 return JSValue::encode(jsUndefined());2687 auto& impl = castedThis->wrapped();2688 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateAttributeRaises(*state, *context, ec));2642 return jsUndefined(); 2643 auto& impl = thisObject->wrapped(); 2644 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAndScriptStateAttributeRaises(*state, *context, ec)); 2689 2645 setDOMException(state, throwScope, ec); 2690 return JSValue::encode(result); 2691 } 2692 2646 return result; 2647 } 2648 2649 static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2693 2650 2694 2651 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2695 2652 { 2696 VM& vm = state->vm(); 2697 auto throwScope = DECLARE_THROW_SCOPE(vm); 2698 UNUSED_PARAM(throwScope); 2699 UNUSED_PARAM(thisValue); 2700 JSValue decodedThisValue = JSValue::decode(thisValue); 2701 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2702 if (UNLIKELY(!castedThis)) { 2703 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateWithSpacesAttribute"); 2704 } 2653 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter>(state, thisValue, "withScriptExecutionContextAndScriptStateWithSpacesAttribute"); 2654 } 2655 2656 static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2657 { 2658 UNUSED_PARAM(throwScope); 2659 UNUSED_PARAM(state); 2705 2660 auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); 2706 2661 if (!context) 2707 return JSValue::encode(jsUndefined()); 2708 auto& impl = castedThis->wrapped(); 2709 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *context)); 2710 return JSValue::encode(result); 2711 } 2712 2662 return jsUndefined(); 2663 auto& impl = thisObject->wrapped(); 2664 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *context)); 2665 return result; 2666 } 2667 2668 static inline JSValue jsTestObjWithScriptArgumentsAndCallStackAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2713 2669 2714 2670 EncodedJSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2715 2671 { 2716 VM& vm = state->vm(); 2717 auto throwScope = DECLARE_THROW_SCOPE(vm); 2718 UNUSED_PARAM(throwScope); 2719 UNUSED_PARAM(thisValue); 2720 JSValue decodedThisValue = JSValue::decode(thisValue); 2721 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2722 if (UNLIKELY(!castedThis)) { 2723 return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptArgumentsAndCallStackAttribute"); 2724 } 2725 auto& impl = castedThis->wrapped(); 2726 JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptArgumentsAndCallStackAttribute()); 2727 return JSValue::encode(result); 2728 } 2729 2672 return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptArgumentsAndCallStackAttributeGetter>(state, thisValue, "withScriptArgumentsAndCallStackAttribute"); 2673 } 2674 2675 static inline JSValue jsTestObjWithScriptArgumentsAndCallStackAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2676 { 2677 UNUSED_PARAM(throwScope); 2678 UNUSED_PARAM(state); 2679 auto& impl = thisObject->wrapped(); 2680 JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptArgumentsAndCallStackAttribute()); 2681 return result; 2682 } 2730 2683 2731 2684 #if ENABLE(Condition1) 2685 static inline JSValue jsTestObjConditionalAttr1Getter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2686 2732 2687 EncodedJSValue jsTestObjConditionalAttr1(ExecState* state, EncodedJSValue thisValue, PropertyName) 2733 2688 { 2734 VM& vm = state->vm(); 2735 auto throwScope = DECLARE_THROW_SCOPE(vm); 2736 UNUSED_PARAM(throwScope); 2737 UNUSED_PARAM(thisValue); 2738 JSValue decodedThisValue = JSValue::decode(thisValue); 2739 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2740 if (UNLIKELY(!castedThis)) { 2741 return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr1"); 2742 } 2743 auto& impl = castedThis->wrapped(); 2689 return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr1Getter>(state, thisValue, "conditionalAttr1"); 2690 } 2691 2692 static inline JSValue jsTestObjConditionalAttr1Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2693 { 2694 UNUSED_PARAM(throwScope); 2695 UNUSED_PARAM(state); 2696 auto& impl = thisObject->wrapped(); 2744 2697 JSValue result = jsNumber(impl.conditionalAttr1()); 2745 return JSValue::encode(result);2698 return result; 2746 2699 } 2747 2700 … … 2749 2702 2750 2703 #if ENABLE(Condition1) && ENABLE(Condition2) 2704 static inline JSValue jsTestObjConditionalAttr2Getter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2705 2751 2706 EncodedJSValue jsTestObjConditionalAttr2(ExecState* state, EncodedJSValue thisValue, PropertyName) 2752 2707 { 2753 VM& vm = state->vm(); 2754 auto throwScope = DECLARE_THROW_SCOPE(vm); 2755 UNUSED_PARAM(throwScope); 2756 UNUSED_PARAM(thisValue); 2757 JSValue decodedThisValue = JSValue::decode(thisValue); 2758 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2759 if (UNLIKELY(!castedThis)) { 2760 return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr2"); 2761 } 2762 auto& impl = castedThis->wrapped(); 2708 return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr2Getter>(state, thisValue, "conditionalAttr2"); 2709 } 2710 2711 static inline JSValue jsTestObjConditionalAttr2Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2712 { 2713 UNUSED_PARAM(throwScope); 2714 UNUSED_PARAM(state); 2715 auto& impl = thisObject->wrapped(); 2763 2716 JSValue result = jsNumber(impl.conditionalAttr2()); 2764 return JSValue::encode(result);2717 return result; 2765 2718 } 2766 2719 … … 2768 2721 2769 2722 #if ENABLE(Condition1) || ENABLE(Condition2) 2723 static inline JSValue jsTestObjConditionalAttr3Getter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2724 2770 2725 EncodedJSValue jsTestObjConditionalAttr3(ExecState* state, EncodedJSValue thisValue, PropertyName) 2771 2726 { 2772 VM& vm = state->vm(); 2773 auto throwScope = DECLARE_THROW_SCOPE(vm); 2774 UNUSED_PARAM(throwScope); 2775 UNUSED_PARAM(thisValue); 2776 JSValue decodedThisValue = JSValue::decode(thisValue); 2777 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2778 if (UNLIKELY(!castedThis)) { 2779 return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr3"); 2780 } 2781 auto& impl = castedThis->wrapped(); 2727 return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr3Getter>(state, thisValue, "conditionalAttr3"); 2728 } 2729 2730 static inline JSValue jsTestObjConditionalAttr3Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2731 { 2732 UNUSED_PARAM(throwScope); 2733 UNUSED_PARAM(state); 2734 auto& impl = thisObject->wrapped(); 2782 2735 JSValue result = jsNumber(impl.conditionalAttr3()); 2783 return JSValue::encode(result);2736 return result; 2784 2737 } 2785 2738 … … 2787 2740 2788 2741 #if ENABLE(Condition1) 2742 static inline JSValue jsTestObjConditionalAttr4ConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2743 2789 2744 EncodedJSValue jsTestObjConditionalAttr4Constructor(ExecState* state, EncodedJSValue thisValue, PropertyName) 2790 2745 { 2791 VM& vm = state->vm(); 2792 auto throwScope = DECLARE_THROW_SCOPE(vm); 2793 UNUSED_PARAM(throwScope); 2794 UNUSED_PARAM(thisValue); 2795 JSValue decodedThisValue = JSValue::decode(thisValue); 2796 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2797 if (UNLIKELY(!castedThis)) { 2798 return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr4"); 2799 } 2800 return JSValue::encode(JSTestObjectA::getConstructor(state->vm(), castedThis->globalObject())); 2746 return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr4ConstructorGetter>(state, thisValue, "conditionalAttr4"); 2747 } 2748 2749 static inline JSValue jsTestObjConditionalAttr4ConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2750 { 2751 UNUSED_PARAM(throwScope); 2752 UNUSED_PARAM(state); 2753 return JSTestObjectA::getConstructor(state->vm(), thisObject->globalObject()); 2801 2754 } 2802 2755 … … 2804 2757 2805 2758 #if ENABLE(Condition1) && ENABLE(Condition2) 2759 static inline JSValue jsTestObjConditionalAttr5ConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2760 2806 2761 EncodedJSValue jsTestObjConditionalAttr5Constructor(ExecState* state, EncodedJSValue thisValue, PropertyName) 2807 2762 { 2808 VM& vm = state->vm(); 2809 auto throwScope = DECLARE_THROW_SCOPE(vm); 2810 UNUSED_PARAM(throwScope); 2811 UNUSED_PARAM(thisValue); 2812 JSValue decodedThisValue = JSValue::decode(thisValue); 2813 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2814 if (UNLIKELY(!castedThis)) { 2815 return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr5"); 2816 } 2817 return JSValue::encode(JSTestObjectB::getConstructor(state->vm(), castedThis->globalObject())); 2763 return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr5ConstructorGetter>(state, thisValue, "conditionalAttr5"); 2764 } 2765 2766 static inline JSValue jsTestObjConditionalAttr5ConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2767 { 2768 UNUSED_PARAM(throwScope); 2769 UNUSED_PARAM(state); 2770 return JSTestObjectB::getConstructor(state->vm(), thisObject->globalObject()); 2818 2771 } 2819 2772 … … 2821 2774 2822 2775 #if ENABLE(Condition1) || ENABLE(Condition2) 2776 static inline JSValue jsTestObjConditionalAttr6ConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2777 2823 2778 EncodedJSValue jsTestObjConditionalAttr6Constructor(ExecState* state, EncodedJSValue thisValue, PropertyName) 2824 2779 { 2825 VM& vm = state->vm();2826 auto throwScope = DECLARE_THROW_SCOPE(vm); 2827 UNUSED_PARAM(throwScope); 2828 UNUSED_PARAM(thisValue); 2829 JSValue decodedThisValue = JSValue::decode(thisValue); 2830 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);2831 if (UNLIKELY(!castedThis)) {2832 return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr6");2833 2834 return JSValue::encode(JSTestObjectC::getConstructor(state->vm(), castedThis->globalObject())); 2835 } 2836 2837 #endif 2780 return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr6ConstructorGetter>(state, thisValue, "conditionalAttr6"); 2781 } 2782 2783 static inline JSValue jsTestObjConditionalAttr6ConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2784 { 2785 UNUSED_PARAM(throwScope); 2786 UNUSED_PARAM(state); 2787 return JSTestObjectC::getConstructor(state->vm(), thisObject->globalObject()); 2788 } 2789 2790 #endif 2791 2792 static inline JSValue jsTestObjCachedAttribute1Getter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2838 2793 2839 2794 EncodedJSValue jsTestObjCachedAttribute1(ExecState* state, EncodedJSValue thisValue, PropertyName) 2840 2795 { 2841 VM& vm = state->vm(); 2842 auto throwScope = DECLARE_THROW_SCOPE(vm); 2843 UNUSED_PARAM(throwScope); 2844 UNUSED_PARAM(thisValue); 2845 JSValue decodedThisValue = JSValue::decode(thisValue); 2846 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2847 if (UNLIKELY(!castedThis)) { 2848 return throwGetterTypeError(*state, throwScope, "TestObject", "cachedAttribute1"); 2849 } 2850 if (JSValue cachedValue = castedThis->m_cachedAttribute1.get()) 2851 return JSValue::encode(cachedValue); 2852 auto& impl = castedThis->wrapped(); 2796 return BindingCaller<JSTestObj>::attribute<jsTestObjCachedAttribute1Getter>(state, thisValue, "cachedAttribute1"); 2797 } 2798 2799 static inline JSValue jsTestObjCachedAttribute1Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2800 { 2801 UNUSED_PARAM(throwScope); 2802 UNUSED_PARAM(state); 2803 if (JSValue cachedValue = thisObject->m_cachedAttribute1.get()) 2804 return cachedValue; 2805 auto& impl = thisObject->wrapped(); 2853 2806 JSValue result = impl.cachedAttribute1(); 2854 castedThis->m_cachedAttribute1.set(state->vm(), castedThis, result); 2855 return JSValue::encode(result); 2856 } 2857 2807 thisObject->m_cachedAttribute1.set(state->vm(), thisObject, result); 2808 return result; 2809 } 2810 2811 static inline JSValue jsTestObjCachedAttribute2Getter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2858 2812 2859 2813 EncodedJSValue jsTestObjCachedAttribute2(ExecState* state, EncodedJSValue thisValue, PropertyName) 2860 2814 { 2861 VM& vm = state->vm(); 2862 auto throwScope = DECLARE_THROW_SCOPE(vm); 2863 UNUSED_PARAM(throwScope); 2864 UNUSED_PARAM(thisValue); 2865 JSValue decodedThisValue = JSValue::decode(thisValue); 2866 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2867 if (UNLIKELY(!castedThis)) { 2868 return throwGetterTypeError(*state, throwScope, "TestObject", "cachedAttribute2"); 2869 } 2870 if (JSValue cachedValue = castedThis->m_cachedAttribute2.get()) 2871 return JSValue::encode(cachedValue); 2872 auto& impl = castedThis->wrapped(); 2815 return BindingCaller<JSTestObj>::attribute<jsTestObjCachedAttribute2Getter>(state, thisValue, "cachedAttribute2"); 2816 } 2817 2818 static inline JSValue jsTestObjCachedAttribute2Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2819 { 2820 UNUSED_PARAM(throwScope); 2821 UNUSED_PARAM(state); 2822 if (JSValue cachedValue = thisObject->m_cachedAttribute2.get()) 2823 return cachedValue; 2824 auto& impl = thisObject->wrapped(); 2873 2825 JSValue result = impl.cachedAttribute2(); 2874 castedThis->m_cachedAttribute2.set(state->vm(), castedThis, result); 2875 return JSValue::encode(result); 2876 } 2877 2826 thisObject->m_cachedAttribute2.set(state->vm(), thisObject, result); 2827 return result; 2828 } 2829 2830 static inline JSValue jsTestObjAnyAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2878 2831 2879 2832 EncodedJSValue jsTestObjAnyAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 2880 2833 { 2881 VM& vm = state->vm(); 2882 auto throwScope = DECLARE_THROW_SCOPE(vm); 2883 UNUSED_PARAM(throwScope); 2884 UNUSED_PARAM(thisValue); 2885 JSValue decodedThisValue = JSValue::decode(thisValue); 2886 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2887 if (UNLIKELY(!castedThis)) { 2888 return throwGetterTypeError(*state, throwScope, "TestObject", "anyAttribute"); 2889 } 2890 auto& impl = castedThis->wrapped(); 2834 return BindingCaller<JSTestObj>::attribute<jsTestObjAnyAttributeGetter>(state, thisValue, "anyAttribute"); 2835 } 2836 2837 static inline JSValue jsTestObjAnyAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2838 { 2839 UNUSED_PARAM(throwScope); 2840 UNUSED_PARAM(state); 2841 auto& impl = thisObject->wrapped(); 2891 2842 JSValue result = impl.anyAttribute(); 2892 return JSValue::encode(result); 2893 } 2894 2843 return result; 2844 } 2845 2846 static inline JSValue jsTestObjContentDocumentGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2895 2847 2896 2848 EncodedJSValue jsTestObjContentDocument(ExecState* state, EncodedJSValue thisValue, PropertyName) 2897 2849 { 2898 VM& vm = state->vm(); 2899 auto throwScope = DECLARE_THROW_SCOPE(vm); 2900 UNUSED_PARAM(throwScope); 2901 UNUSED_PARAM(thisValue); 2902 JSValue decodedThisValue = JSValue::decode(thisValue); 2903 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2904 if (UNLIKELY(!castedThis)) { 2905 return throwGetterTypeError(*state, throwScope, "TestObject", "contentDocument"); 2906 } 2907 auto& impl = castedThis->wrapped(); 2908 return JSValue::encode(shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, castedThis->globalObject(), impl.contentDocument()) : jsNull()); 2909 } 2910 2850 return BindingCaller<JSTestObj>::attribute<jsTestObjContentDocumentGetter>(state, thisValue, "contentDocument"); 2851 } 2852 2853 static inline JSValue jsTestObjContentDocumentGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2854 { 2855 UNUSED_PARAM(throwScope); 2856 UNUSED_PARAM(state); 2857 auto& impl = thisObject->wrapped(); 2858 return shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, thisObject->globalObject(), impl.contentDocument()) : jsNull(); 2859 } 2860 2861 static inline JSValue jsTestObjMutablePointGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2911 2862 2912 2863 EncodedJSValue jsTestObjMutablePoint(ExecState* state, EncodedJSValue thisValue, PropertyName) 2913 2864 { 2914 VM& vm = state->vm(); 2915 auto throwScope = DECLARE_THROW_SCOPE(vm); 2916 UNUSED_PARAM(throwScope); 2917 UNUSED_PARAM(thisValue); 2918 JSValue decodedThisValue = JSValue::decode(thisValue); 2919 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2920 if (UNLIKELY(!castedThis)) { 2921 return throwGetterTypeError(*state, throwScope, "TestObject", "mutablePoint"); 2922 } 2923 auto& impl = castedThis->wrapped(); 2924 JSValue result = toJS(state, castedThis->globalObject(), SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint)); 2925 return JSValue::encode(result); 2926 } 2927 2865 return BindingCaller<JSTestObj>::attribute<jsTestObjMutablePointGetter>(state, thisValue, "mutablePoint"); 2866 } 2867 2868 static inline JSValue jsTestObjMutablePointGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2869 { 2870 UNUSED_PARAM(throwScope); 2871 UNUSED_PARAM(state); 2872 auto& impl = thisObject->wrapped(); 2873 JSValue result = toJS(state, thisObject->globalObject(), SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint)); 2874 return result; 2875 } 2876 2877 static inline JSValue jsTestObjImmutablePointGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2928 2878 2929 2879 EncodedJSValue jsTestObjImmutablePoint(ExecState* state, EncodedJSValue thisValue, PropertyName) 2930 2880 { 2931 VM& vm = state->vm(); 2932 auto throwScope = DECLARE_THROW_SCOPE(vm); 2933 UNUSED_PARAM(throwScope); 2934 UNUSED_PARAM(thisValue); 2935 JSValue decodedThisValue = JSValue::decode(thisValue); 2936 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2937 if (UNLIKELY(!castedThis)) { 2938 return throwGetterTypeError(*state, throwScope, "TestObject", "immutablePoint"); 2939 } 2940 auto& impl = castedThis->wrapped(); 2941 JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint())); 2942 return JSValue::encode(result); 2943 } 2944 2881 return BindingCaller<JSTestObj>::attribute<jsTestObjImmutablePointGetter>(state, thisValue, "immutablePoint"); 2882 } 2883 2884 static inline JSValue jsTestObjImmutablePointGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2885 { 2886 UNUSED_PARAM(throwScope); 2887 UNUSED_PARAM(state); 2888 auto& impl = thisObject->wrapped(); 2889 JSValue result = toJS(state, thisObject->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint())); 2890 return result; 2891 } 2892 2893 static inline JSValue jsTestObjStrawberryGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2945 2894 2946 2895 EncodedJSValue jsTestObjStrawberry(ExecState* state, EncodedJSValue thisValue, PropertyName) 2947 2896 { 2948 VM& vm = state->vm(); 2949 auto throwScope = DECLARE_THROW_SCOPE(vm); 2950 UNUSED_PARAM(throwScope); 2951 UNUSED_PARAM(thisValue); 2952 JSValue decodedThisValue = JSValue::decode(thisValue); 2953 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2954 if (UNLIKELY(!castedThis)) { 2955 return throwGetterTypeError(*state, throwScope, "TestObject", "strawberry"); 2956 } 2957 auto& impl = castedThis->wrapped(); 2897 return BindingCaller<JSTestObj>::attribute<jsTestObjStrawberryGetter>(state, thisValue, "strawberry"); 2898 } 2899 2900 static inline JSValue jsTestObjStrawberryGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2901 { 2902 UNUSED_PARAM(throwScope); 2903 UNUSED_PARAM(state); 2904 auto& impl = thisObject->wrapped(); 2958 2905 JSValue result = jsNumber(impl.blueberry()); 2959 return JSValue::encode(result); 2960 } 2961 2906 return result; 2907 } 2908 2909 static inline JSValue jsTestObjDescriptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2962 2910 2963 2911 EncodedJSValue jsTestObjDescription(ExecState* state, EncodedJSValue thisValue, PropertyName) 2964 2912 { 2965 VM& vm = state->vm(); 2966 auto throwScope = DECLARE_THROW_SCOPE(vm); 2967 UNUSED_PARAM(throwScope); 2968 UNUSED_PARAM(thisValue); 2969 JSValue decodedThisValue = JSValue::decode(thisValue); 2970 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2971 if (UNLIKELY(!castedThis)) { 2972 return throwGetterTypeError(*state, throwScope, "TestObject", "description"); 2973 } 2974 auto& impl = castedThis->wrapped(); 2913 return BindingCaller<JSTestObj>::attribute<jsTestObjDescriptionGetter>(state, thisValue, "description"); 2914 } 2915 2916 static inline JSValue jsTestObjDescriptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2917 { 2918 UNUSED_PARAM(throwScope); 2919 UNUSED_PARAM(state); 2920 auto& impl = thisObject->wrapped(); 2975 2921 JSValue result = jsNumber(impl.description()); 2976 return JSValue::encode(result); 2977 } 2978 2922 return result; 2923 } 2924 2925 static inline JSValue jsTestObjIdGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2979 2926 2980 2927 EncodedJSValue jsTestObjId(ExecState* state, EncodedJSValue thisValue, PropertyName) 2981 2928 { 2982 VM& vm = state->vm(); 2983 auto throwScope = DECLARE_THROW_SCOPE(vm); 2984 UNUSED_PARAM(throwScope); 2985 UNUSED_PARAM(thisValue); 2986 JSValue decodedThisValue = JSValue::decode(thisValue); 2987 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 2988 if (UNLIKELY(!castedThis)) { 2989 return throwGetterTypeError(*state, throwScope, "TestObject", "id"); 2990 } 2991 auto& impl = castedThis->wrapped(); 2929 return BindingCaller<JSTestObj>::attribute<jsTestObjIdGetter>(state, thisValue, "id"); 2930 } 2931 2932 static inline JSValue jsTestObjIdGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2933 { 2934 UNUSED_PARAM(throwScope); 2935 UNUSED_PARAM(state); 2936 auto& impl = thisObject->wrapped(); 2992 2937 JSValue result = jsNumber(impl.id()); 2993 return JSValue::encode(result); 2994 } 2995 2938 return result; 2939 } 2940 2941 static inline JSValue jsTestObjHashGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 2996 2942 2997 2943 EncodedJSValue jsTestObjHash(ExecState* state, EncodedJSValue thisValue, PropertyName) 2998 2944 { 2999 VM& vm = state->vm(); 3000 auto throwScope = DECLARE_THROW_SCOPE(vm); 3001 UNUSED_PARAM(throwScope); 3002 UNUSED_PARAM(thisValue); 3003 JSValue decodedThisValue = JSValue::decode(thisValue); 3004 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3005 if (UNLIKELY(!castedThis)) { 3006 return throwGetterTypeError(*state, throwScope, "TestObject", "hash"); 3007 } 3008 auto& impl = castedThis->wrapped(); 2945 return BindingCaller<JSTestObj>::attribute<jsTestObjHashGetter>(state, thisValue, "hash"); 2946 } 2947 2948 static inline JSValue jsTestObjHashGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2949 { 2950 UNUSED_PARAM(throwScope); 2951 UNUSED_PARAM(state); 2952 auto& impl = thisObject->wrapped(); 3009 2953 JSValue result = jsStringWithCache(state, impl.hash()); 3010 return JSValue::encode(result); 3011 } 3012 2954 return result; 2955 } 2956 2957 static inline JSValue jsTestObjReplaceableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3013 2958 3014 2959 EncodedJSValue jsTestObjReplaceableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3015 2960 { 3016 VM& vm = state->vm(); 3017 auto throwScope = DECLARE_THROW_SCOPE(vm); 3018 UNUSED_PARAM(throwScope); 3019 UNUSED_PARAM(thisValue); 3020 JSValue decodedThisValue = JSValue::decode(thisValue); 3021 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3022 if (UNLIKELY(!castedThis)) { 3023 return throwGetterTypeError(*state, throwScope, "TestObject", "replaceableAttribute"); 3024 } 3025 auto& impl = castedThis->wrapped(); 2961 return BindingCaller<JSTestObj>::attribute<jsTestObjReplaceableAttributeGetter>(state, thisValue, "replaceableAttribute"); 2962 } 2963 2964 static inline JSValue jsTestObjReplaceableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2965 { 2966 UNUSED_PARAM(throwScope); 2967 UNUSED_PARAM(state); 2968 auto& impl = thisObject->wrapped(); 3026 2969 JSValue result = jsNumber(impl.replaceableAttribute()); 3027 return JSValue::encode(result); 3028 } 3029 2970 return result; 2971 } 2972 2973 static inline JSValue jsTestObjNullableDoubleAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3030 2974 3031 2975 EncodedJSValue jsTestObjNullableDoubleAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3032 2976 { 3033 VM& vm = state->vm(); 3034 auto throwScope = DECLARE_THROW_SCOPE(vm); 3035 UNUSED_PARAM(throwScope); 3036 UNUSED_PARAM(thisValue); 3037 JSValue decodedThisValue = JSValue::decode(thisValue); 3038 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3039 if (UNLIKELY(!castedThis)) { 3040 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableDoubleAttribute"); 3041 } 3042 auto& impl = castedThis->wrapped(); 2977 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableDoubleAttributeGetter>(state, thisValue, "nullableDoubleAttribute"); 2978 } 2979 2980 static inline JSValue jsTestObjNullableDoubleAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2981 { 2982 UNUSED_PARAM(throwScope); 2983 UNUSED_PARAM(state); 2984 auto& impl = thisObject->wrapped(); 3043 2985 JSValue result = toNullableJSNumber(impl.nullableDoubleAttribute()); 3044 return JSValue::encode(result); 3045 } 3046 2986 return result; 2987 } 2988 2989 static inline JSValue jsTestObjNullableLongAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3047 2990 3048 2991 EncodedJSValue jsTestObjNullableLongAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3049 2992 { 3050 VM& vm = state->vm(); 3051 auto throwScope = DECLARE_THROW_SCOPE(vm); 3052 UNUSED_PARAM(throwScope); 3053 UNUSED_PARAM(thisValue); 3054 JSValue decodedThisValue = JSValue::decode(thisValue); 3055 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3056 if (UNLIKELY(!castedThis)) { 3057 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableLongAttribute"); 3058 } 3059 auto& impl = castedThis->wrapped(); 2993 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableLongAttributeGetter>(state, thisValue, "nullableLongAttribute"); 2994 } 2995 2996 static inline JSValue jsTestObjNullableLongAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 2997 { 2998 UNUSED_PARAM(throwScope); 2999 UNUSED_PARAM(state); 3000 auto& impl = thisObject->wrapped(); 3060 3001 JSValue result = toNullableJSNumber(impl.nullableLongAttribute()); 3061 return JSValue::encode(result); 3062 } 3063 3002 return result; 3003 } 3004 3005 static inline JSValue jsTestObjNullableBooleanAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3064 3006 3065 3007 EncodedJSValue jsTestObjNullableBooleanAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3066 3008 { 3067 VM& vm = state->vm(); 3068 auto throwScope = DECLARE_THROW_SCOPE(vm); 3069 UNUSED_PARAM(throwScope); 3070 UNUSED_PARAM(thisValue); 3071 JSValue decodedThisValue = JSValue::decode(thisValue); 3072 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3073 if (UNLIKELY(!castedThis)) { 3074 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableBooleanAttribute"); 3075 } 3076 auto& impl = castedThis->wrapped(); 3009 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableBooleanAttributeGetter>(state, thisValue, "nullableBooleanAttribute"); 3010 } 3011 3012 static inline JSValue jsTestObjNullableBooleanAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3013 { 3014 UNUSED_PARAM(throwScope); 3015 UNUSED_PARAM(state); 3016 auto& impl = thisObject->wrapped(); 3077 3017 JSValue result = jsBoolean(impl.nullableBooleanAttribute()); 3078 return JSValue::encode(result); 3079 } 3080 3018 return result; 3019 } 3020 3021 static inline JSValue jsTestObjNullableStringAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3081 3022 3082 3023 EncodedJSValue jsTestObjNullableStringAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3083 3024 { 3084 VM& vm = state->vm(); 3085 auto throwScope = DECLARE_THROW_SCOPE(vm); 3086 UNUSED_PARAM(throwScope); 3087 UNUSED_PARAM(thisValue); 3088 JSValue decodedThisValue = JSValue::decode(thisValue); 3089 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3090 if (UNLIKELY(!castedThis)) { 3091 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableStringAttribute"); 3092 } 3093 auto& impl = castedThis->wrapped(); 3025 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableStringAttributeGetter>(state, thisValue, "nullableStringAttribute"); 3026 } 3027 3028 static inline JSValue jsTestObjNullableStringAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3029 { 3030 UNUSED_PARAM(throwScope); 3031 UNUSED_PARAM(state); 3032 auto& impl = thisObject->wrapped(); 3094 3033 JSValue result = jsStringOrNull(state, impl.nullableStringAttribute()); 3095 return JSValue::encode(result); 3096 } 3097 3034 return result; 3035 } 3036 3037 static inline JSValue jsTestObjNullableLongSettableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3098 3038 3099 3039 EncodedJSValue jsTestObjNullableLongSettableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3100 3040 { 3101 VM& vm = state->vm(); 3102 auto throwScope = DECLARE_THROW_SCOPE(vm); 3103 UNUSED_PARAM(throwScope); 3104 UNUSED_PARAM(thisValue); 3105 JSValue decodedThisValue = JSValue::decode(thisValue); 3106 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3107 if (UNLIKELY(!castedThis)) { 3108 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableLongSettableAttribute"); 3109 } 3110 auto& impl = castedThis->wrapped(); 3041 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableLongSettableAttributeGetter>(state, thisValue, "nullableLongSettableAttribute"); 3042 } 3043 3044 static inline JSValue jsTestObjNullableLongSettableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3045 { 3046 UNUSED_PARAM(throwScope); 3047 UNUSED_PARAM(state); 3048 auto& impl = thisObject->wrapped(); 3111 3049 JSValue result = toNullableJSNumber(impl.nullableLongSettableAttribute()); 3112 return JSValue::encode(result); 3113 } 3114 3050 return result; 3051 } 3052 3053 static inline JSValue jsTestObjNullableStringSettableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3115 3054 3116 3055 EncodedJSValue jsTestObjNullableStringSettableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3117 3056 { 3118 VM& vm = state->vm(); 3119 auto throwScope = DECLARE_THROW_SCOPE(vm); 3120 UNUSED_PARAM(throwScope); 3121 UNUSED_PARAM(thisValue); 3122 JSValue decodedThisValue = JSValue::decode(thisValue); 3123 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3124 if (UNLIKELY(!castedThis)) { 3125 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableStringSettableAttribute"); 3126 } 3127 auto& impl = castedThis->wrapped(); 3057 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableStringSettableAttributeGetter>(state, thisValue, "nullableStringSettableAttribute"); 3058 } 3059 3060 static inline JSValue jsTestObjNullableStringSettableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3061 { 3062 UNUSED_PARAM(throwScope); 3063 UNUSED_PARAM(state); 3064 auto& impl = thisObject->wrapped(); 3128 3065 JSValue result = jsStringOrNull(state, impl.nullableStringSettableAttribute()); 3129 return JSValue::encode(result); 3130 } 3131 3066 return result; 3067 } 3068 3069 static inline JSValue jsTestObjNullableUSVStringSettableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3132 3070 3133 3071 EncodedJSValue jsTestObjNullableUSVStringSettableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3134 3072 { 3135 VM& vm = state->vm(); 3136 auto throwScope = DECLARE_THROW_SCOPE(vm); 3137 UNUSED_PARAM(throwScope); 3138 UNUSED_PARAM(thisValue); 3139 JSValue decodedThisValue = JSValue::decode(thisValue); 3140 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3141 if (UNLIKELY(!castedThis)) { 3142 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableUSVStringSettableAttribute"); 3143 } 3144 auto& impl = castedThis->wrapped(); 3073 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableUSVStringSettableAttributeGetter>(state, thisValue, "nullableUSVStringSettableAttribute"); 3074 } 3075 3076 static inline JSValue jsTestObjNullableUSVStringSettableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3077 { 3078 UNUSED_PARAM(throwScope); 3079 UNUSED_PARAM(state); 3080 auto& impl = thisObject->wrapped(); 3145 3081 JSValue result = jsStringOrNull(state, impl.nullableUSVStringSettableAttribute()); 3146 return JSValue::encode(result); 3147 } 3148 3082 return result; 3083 } 3084 3085 static inline JSValue jsTestObjNullableStringValueGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3149 3086 3150 3087 EncodedJSValue jsTestObjNullableStringValue(ExecState* state, EncodedJSValue thisValue, PropertyName) 3151 3088 { 3152 VM& vm = state->vm(); 3153 auto throwScope = DECLARE_THROW_SCOPE(vm); 3154 UNUSED_PARAM(throwScope); 3155 UNUSED_PARAM(thisValue); 3156 JSValue decodedThisValue = JSValue::decode(thisValue); 3157 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3158 if (UNLIKELY(!castedThis)) { 3159 return throwGetterTypeError(*state, throwScope, "TestObject", "nullableStringValue"); 3160 } 3089 return BindingCaller<JSTestObj>::attribute<jsTestObjNullableStringValueGetter>(state, thisValue, "nullableStringValue"); 3090 } 3091 3092 static inline JSValue jsTestObjNullableStringValueGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3093 { 3094 UNUSED_PARAM(throwScope); 3095 UNUSED_PARAM(state); 3161 3096 ExceptionCode ec = 0; 3162 auto& impl = castedThis->wrapped();3097 auto& impl = thisObject->wrapped(); 3163 3098 JSValue result = toNullableJSNumber(impl.nullableStringValue(ec)); 3164 3099 setDOMException(state, throwScope, ec); 3165 return JSValue::encode(result); 3166 } 3167 3100 return result; 3101 } 3102 3103 static inline JSValue jsTestObjAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3168 3104 3169 3105 EncodedJSValue jsTestObjAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3170 3106 { 3171 VM& vm = state->vm(); 3172 auto throwScope = DECLARE_THROW_SCOPE(vm); 3173 UNUSED_PARAM(throwScope); 3174 UNUSED_PARAM(thisValue); 3175 JSValue decodedThisValue = JSValue::decode(thisValue); 3176 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3177 if (UNLIKELY(!castedThis)) { 3178 return throwGetterTypeError(*state, throwScope, "TestObject", "attribute"); 3179 } 3180 auto& impl = castedThis->wrapped(); 3107 return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeGetter>(state, thisValue, "attribute"); 3108 } 3109 3110 static inline JSValue jsTestObjAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3111 { 3112 UNUSED_PARAM(throwScope); 3113 UNUSED_PARAM(state); 3114 auto& impl = thisObject->wrapped(); 3181 3115 JSValue result = jsStringWithCache(state, impl.attribute()); 3182 return JSValue::encode(result); 3183 } 3184 3116 return result; 3117 } 3118 3119 static inline JSValue jsTestObjAttributeWithReservedEnumTypeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3185 3120 3186 3121 EncodedJSValue jsTestObjAttributeWithReservedEnumType(ExecState* state, EncodedJSValue thisValue, PropertyName) 3187 3122 { 3188 VM& vm = state->vm(); 3189 auto throwScope = DECLARE_THROW_SCOPE(vm); 3190 UNUSED_PARAM(throwScope); 3191 UNUSED_PARAM(thisValue); 3192 JSValue decodedThisValue = JSValue::decode(thisValue); 3193 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3194 if (UNLIKELY(!castedThis)) { 3195 return throwGetterTypeError(*state, throwScope, "TestObject", "attributeWithReservedEnumType"); 3196 } 3197 auto& impl = castedThis->wrapped(); 3123 return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeWithReservedEnumTypeGetter>(state, thisValue, "attributeWithReservedEnumType"); 3124 } 3125 3126 static inline JSValue jsTestObjAttributeWithReservedEnumTypeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3127 { 3128 UNUSED_PARAM(throwScope); 3129 UNUSED_PARAM(state); 3130 auto& impl = thisObject->wrapped(); 3198 3131 JSValue result = jsStringWithCache(state, impl.attributeWithReservedEnumType()); 3199 return JSValue::encode(result); 3200 } 3201 3132 return result; 3133 } 3134 3135 static inline JSValue jsTestObjPutForwardsAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3202 3136 3203 3137 EncodedJSValue jsTestObjPutForwardsAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3204 3138 { 3205 VM& vm = state->vm(); 3206 auto throwScope = DECLARE_THROW_SCOPE(vm); 3207 UNUSED_PARAM(throwScope); 3208 UNUSED_PARAM(thisValue); 3209 JSValue decodedThisValue = JSValue::decode(thisValue); 3210 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3211 if (UNLIKELY(!castedThis)) { 3212 return throwGetterTypeError(*state, throwScope, "TestObject", "putForwardsAttribute"); 3213 } 3214 auto& impl = castedThis->wrapped(); 3215 JSValue result = toJS(state, castedThis->globalObject(), impl.putForwardsAttribute()); 3216 return JSValue::encode(result); 3217 } 3218 3139 return BindingCaller<JSTestObj>::attribute<jsTestObjPutForwardsAttributeGetter>(state, thisValue, "putForwardsAttribute"); 3140 } 3141 3142 static inline JSValue jsTestObjPutForwardsAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3143 { 3144 UNUSED_PARAM(throwScope); 3145 UNUSED_PARAM(state); 3146 auto& impl = thisObject->wrapped(); 3147 JSValue result = toJS(state, thisObject->globalObject(), impl.putForwardsAttribute()); 3148 return result; 3149 } 3150 3151 static inline JSValue jsTestObjPutForwardsNullableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3219 3152 3220 3153 EncodedJSValue jsTestObjPutForwardsNullableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3221 3154 { 3222 VM& vm = state->vm(); 3223 auto throwScope = DECLARE_THROW_SCOPE(vm); 3224 UNUSED_PARAM(throwScope); 3225 UNUSED_PARAM(thisValue); 3226 JSValue decodedThisValue = JSValue::decode(thisValue); 3227 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3228 if (UNLIKELY(!castedThis)) { 3229 return throwGetterTypeError(*state, throwScope, "TestObject", "putForwardsNullableAttribute"); 3230 } 3231 auto& impl = castedThis->wrapped(); 3232 JSValue result = toJS(state, castedThis->globalObject(), impl.putForwardsNullableAttribute()); 3233 return JSValue::encode(result); 3234 } 3235 3155 return BindingCaller<JSTestObj>::attribute<jsTestObjPutForwardsNullableAttributeGetter>(state, thisValue, "putForwardsNullableAttribute"); 3156 } 3157 3158 static inline JSValue jsTestObjPutForwardsNullableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3159 { 3160 UNUSED_PARAM(throwScope); 3161 UNUSED_PARAM(state); 3162 auto& impl = thisObject->wrapped(); 3163 JSValue result = toJS(state, thisObject->globalObject(), impl.putForwardsNullableAttribute()); 3164 return result; 3165 } 3166 3167 static inline JSValue jsTestObjStringifierAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope); 3236 3168 3237 3169 EncodedJSValue jsTestObjStringifierAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName) 3238 3170 { 3239 VM& vm = state->vm(); 3240 auto throwScope = DECLARE_THROW_SCOPE(vm); 3241 UNUSED_PARAM(throwScope); 3242 UNUSED_PARAM(thisValue); 3243 JSValue decodedThisValue = JSValue::decode(thisValue); 3244 auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue); 3245 if (UNLIKELY(!castedThis)) { 3246 return throwGetterTypeError(*state, throwScope, "TestObject", "stringifierAttribute"); 3247 } 3248 auto& impl = castedThis->wrapped(); 3171 return BindingCaller<JSTestObj>::attribute<jsTestObjStringifierAttributeGetter>(state, thisValue, "stringifierAttribute"); 3172 } 3173 3174 static inline JSValue jsTestObjStringifierAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope) 3175 { 3176 UNUSED_PARAM(throwScope); 3177 UNUSED_PARAM(state); 3178 auto& impl = thisObject->wrapped(); 3249 3179 JSValue result = jsStringWithCache(state, impl.stringifierAttribute()); 3250 return JSValue::encode(result); 3251 } 3252 3180 return result; 3181 } 3253 3182 3254 3183 EncodedJSValue jsTestObjConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r206812 r206953 54 54 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode()); 55 55 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 56 static JSTestObj* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 56 57 mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1; 57 58 mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r206723 r206953 133 133 } 134 134 135 inline JSTestSerializedScriptValueInterface* JSTestSerializedScriptValueInterface::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 136 { 137 return jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue)); 138 } 139 140 static inline JSValue jsTestSerializedScriptValueInterfaceValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope); 141 135 142 EncodedJSValue jsTestSerializedScriptValueInterfaceValue(ExecState* state, EncodedJSValue thisValue, PropertyName) 136 143 { 137 VM& vm = state->vm(); 138 auto throwScope = DECLARE_THROW_SCOPE(vm); 139 UNUSED_PARAM(throwScope); 140 UNUSED_PARAM(thisValue); 141 JSValue decodedThisValue = JSValue::decode(thisValue); 142 auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue); 143 if (UNLIKELY(!castedThis)) { 144 return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "value"); 145 } 146 auto& impl = castedThis->wrapped(); 147 JSValue result = impl.value() ? impl.value()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); 148 return JSValue::encode(result); 149 } 150 144 return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceValueGetter>(state, thisValue, "value"); 145 } 146 147 static inline JSValue jsTestSerializedScriptValueInterfaceValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope) 148 { 149 UNUSED_PARAM(throwScope); 150 UNUSED_PARAM(state); 151 auto& impl = thisObject->wrapped(); 152 JSValue result = impl.value() ? impl.value()->deserialize(state, thisObject->globalObject(), 0) : jsNull(); 153 return result; 154 } 155 156 static inline JSValue jsTestSerializedScriptValueInterfaceReadonlyValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope); 151 157 152 158 EncodedJSValue jsTestSerializedScriptValueInterfaceReadonlyValue(ExecState* state, EncodedJSValue thisValue, PropertyName) 153 159 { 154 VM& vm = state->vm(); 155 auto throwScope = DECLARE_THROW_SCOPE(vm); 156 UNUSED_PARAM(throwScope); 157 UNUSED_PARAM(thisValue); 158 JSValue decodedThisValue = JSValue::decode(thisValue); 159 auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue); 160 if (UNLIKELY(!castedThis)) { 161 return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "readonlyValue"); 162 } 163 auto& impl = castedThis->wrapped(); 164 JSValue result = impl.readonlyValue() ? impl.readonlyValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); 165 return JSValue::encode(result); 166 } 167 160 return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceReadonlyValueGetter>(state, thisValue, "readonlyValue"); 161 } 162 163 static inline JSValue jsTestSerializedScriptValueInterfaceReadonlyValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope) 164 { 165 UNUSED_PARAM(throwScope); 166 UNUSED_PARAM(state); 167 auto& impl = thisObject->wrapped(); 168 JSValue result = impl.readonlyValue() ? impl.readonlyValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull(); 169 return result; 170 } 171 172 static inline JSValue jsTestSerializedScriptValueInterfaceCachedValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope); 168 173 169 174 EncodedJSValue jsTestSerializedScriptValueInterfaceCachedValue(ExecState* state, EncodedJSValue thisValue, PropertyName) 170 175 { 171 VM& vm = state->vm(); 172 auto throwScope = DECLARE_THROW_SCOPE(vm); 173 UNUSED_PARAM(throwScope); 174 UNUSED_PARAM(thisValue); 175 JSValue decodedThisValue = JSValue::decode(thisValue); 176 auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue); 177 if (UNLIKELY(!castedThis)) { 178 return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "cachedValue"); 179 } 180 if (JSValue cachedValue = castedThis->m_cachedValue.get()) 181 return JSValue::encode(cachedValue); 182 auto& impl = castedThis->wrapped(); 183 JSValue result = impl.cachedValue() ? impl.cachedValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); 184 castedThis->m_cachedValue.set(state->vm(), castedThis, result); 185 return JSValue::encode(result); 186 } 187 176 return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceCachedValueGetter>(state, thisValue, "cachedValue"); 177 } 178 179 static inline JSValue jsTestSerializedScriptValueInterfaceCachedValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope) 180 { 181 UNUSED_PARAM(throwScope); 182 UNUSED_PARAM(state); 183 if (JSValue cachedValue = thisObject->m_cachedValue.get()) 184 return cachedValue; 185 auto& impl = thisObject->wrapped(); 186 JSValue result = impl.cachedValue() ? impl.cachedValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull(); 187 thisObject->m_cachedValue.set(state->vm(), thisObject, result); 188 return result; 189 } 190 191 static inline JSValue jsTestSerializedScriptValueInterfacePortsGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope); 188 192 189 193 EncodedJSValue jsTestSerializedScriptValueInterfacePorts(ExecState* state, EncodedJSValue thisValue, PropertyName) 190 194 { 191 VM& vm = state->vm(); 192 auto throwScope = DECLARE_THROW_SCOPE(vm); 193 UNUSED_PARAM(throwScope); 194 UNUSED_PARAM(thisValue); 195 JSValue decodedThisValue = JSValue::decode(thisValue); 196 auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue); 197 if (UNLIKELY(!castedThis)) { 198 return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "ports"); 199 } 200 auto& impl = castedThis->wrapped(); 201 JSValue result = jsArray(state, castedThis->globalObject(), impl.ports()); 202 return JSValue::encode(result); 203 } 204 195 return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfacePortsGetter>(state, thisValue, "ports"); 196 } 197 198 static inline JSValue jsTestSerializedScriptValueInterfacePortsGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope) 199 { 200 UNUSED_PARAM(throwScope); 201 UNUSED_PARAM(state); 202 auto& impl = thisObject->wrapped(); 203 JSValue result = jsArray(state, thisObject->globalObject(), impl.ports()); 204 return result; 205 } 206 207 static inline JSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope); 205 208 206 209 EncodedJSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValue(ExecState* state, EncodedJSValue thisValue, PropertyName) 207 210 { 208 VM& vm = state->vm(); 209 auto throwScope = DECLARE_THROW_SCOPE(vm); 210 UNUSED_PARAM(throwScope); 211 UNUSED_PARAM(thisValue); 212 JSValue decodedThisValue = JSValue::decode(thisValue); 213 auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue); 214 if (UNLIKELY(!castedThis)) { 215 return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "cachedReadonlyValue"); 216 } 217 if (JSValue cachedValue = castedThis->m_cachedReadonlyValue.get()) 218 return JSValue::encode(cachedValue); 219 auto& impl = castedThis->wrapped(); 220 JSValue result = impl.cachedReadonlyValue() ? impl.cachedReadonlyValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); 221 castedThis->m_cachedReadonlyValue.set(state->vm(), castedThis, result); 222 return JSValue::encode(result); 223 } 224 211 return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter>(state, thisValue, "cachedReadonlyValue"); 212 } 213 214 static inline JSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope) 215 { 216 UNUSED_PARAM(throwScope); 217 UNUSED_PARAM(state); 218 if (JSValue cachedValue = thisObject->m_cachedReadonlyValue.get()) 219 return cachedValue; 220 auto& impl = thisObject->wrapped(); 221 JSValue result = impl.cachedReadonlyValue() ? impl.cachedReadonlyValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull(); 222 thisObject->m_cachedReadonlyValue.set(state->vm(), thisObject, result); 223 return result; 224 } 225 225 226 226 EncodedJSValue jsTestSerializedScriptValueInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
r206723 r206953 52 52 53 53 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 54 static JSTestSerializedScriptValueInterface* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 54 55 mutable JSC::WriteBarrier<JSC::Unknown> m_cachedValue; 55 56 mutable JSC::WriteBarrier<JSC::Unknown> m_cachedReadonlyValue; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r206723 r206953 211 211 } 212 212 213 inline JSTestTypedefs* JSTestTypedefs::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 214 { 215 return jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue)); 216 } 217 218 static inline JSValue jsTestTypedefsUnsignedLongLongAttrGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 219 213 220 EncodedJSValue jsTestTypedefsUnsignedLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) 214 221 { 215 VM& vm = state->vm(); 216 auto throwScope = DECLARE_THROW_SCOPE(vm); 217 UNUSED_PARAM(throwScope); 218 UNUSED_PARAM(thisValue); 219 JSValue decodedThisValue = JSValue::decode(thisValue); 220 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 221 if (UNLIKELY(!castedThis)) { 222 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "unsignedLongLongAttr"); 223 } 224 auto& impl = castedThis->wrapped(); 222 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsUnsignedLongLongAttrGetter>(state, thisValue, "unsignedLongLongAttr"); 223 } 224 225 static inline JSValue jsTestTypedefsUnsignedLongLongAttrGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 226 { 227 UNUSED_PARAM(throwScope); 228 UNUSED_PARAM(state); 229 auto& impl = thisObject->wrapped(); 225 230 JSValue result = jsNumber(impl.unsignedLongLongAttr()); 226 return JSValue::encode(result); 227 } 228 231 return result; 232 } 233 234 static inline JSValue jsTestTypedefsImmutableSerializedScriptValueGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 229 235 230 236 EncodedJSValue jsTestTypedefsImmutableSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, PropertyName) 231 237 { 232 VM& vm = state->vm(); 233 auto throwScope = DECLARE_THROW_SCOPE(vm); 234 UNUSED_PARAM(throwScope); 235 UNUSED_PARAM(thisValue); 236 JSValue decodedThisValue = JSValue::decode(thisValue); 237 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 238 if (UNLIKELY(!castedThis)) { 239 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "immutableSerializedScriptValue"); 240 } 241 auto& impl = castedThis->wrapped(); 242 JSValue result = impl.immutableSerializedScriptValue() ? impl.immutableSerializedScriptValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull(); 243 return JSValue::encode(result); 244 } 245 238 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsImmutableSerializedScriptValueGetter>(state, thisValue, "immutableSerializedScriptValue"); 239 } 240 241 static inline JSValue jsTestTypedefsImmutableSerializedScriptValueGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 242 { 243 UNUSED_PARAM(throwScope); 244 UNUSED_PARAM(state); 245 auto& impl = thisObject->wrapped(); 246 JSValue result = impl.immutableSerializedScriptValue() ? impl.immutableSerializedScriptValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull(); 247 return result; 248 } 249 250 static inline JSValue jsTestTypedefsConstructorTestSubObjGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 246 251 247 252 EncodedJSValue jsTestTypedefsConstructorTestSubObj(ExecState* state, EncodedJSValue thisValue, PropertyName) 248 253 { 249 VM& vm = state->vm(); 250 auto throwScope = DECLARE_THROW_SCOPE(vm); 251 UNUSED_PARAM(throwScope); 252 UNUSED_PARAM(thisValue); 253 JSValue decodedThisValue = JSValue::decode(thisValue); 254 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 255 if (UNLIKELY(!castedThis)) { 256 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "TestSubObj"); 257 } 258 return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject())); 259 } 260 254 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsConstructorTestSubObjGetter>(state, thisValue, "TestSubObj"); 255 } 256 257 static inline JSValue jsTestTypedefsConstructorTestSubObjGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 258 { 259 UNUSED_PARAM(throwScope); 260 UNUSED_PARAM(state); 261 return JSTestSubObj::getConstructor(state->vm(), thisObject->globalObject()); 262 } 263 264 static inline JSValue jsTestTypedefsAttrWithGetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 261 265 262 266 EncodedJSValue jsTestTypedefsAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 263 267 { 264 VM& vm = state->vm(); 265 auto throwScope = DECLARE_THROW_SCOPE(vm); 266 UNUSED_PARAM(throwScope); 267 UNUSED_PARAM(thisValue); 268 JSValue decodedThisValue = JSValue::decode(thisValue); 269 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 270 if (UNLIKELY(!castedThis)) { 271 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "attrWithGetterException"); 272 } 268 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsAttrWithGetterExceptionGetter>(state, thisValue, "attrWithGetterException"); 269 } 270 271 static inline JSValue jsTestTypedefsAttrWithGetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 272 { 273 UNUSED_PARAM(throwScope); 274 UNUSED_PARAM(state); 273 275 ExceptionCode ec = 0; 274 auto& impl = castedThis->wrapped();276 auto& impl = thisObject->wrapped(); 275 277 JSValue result = jsNumber(impl.attrWithGetterException(ec)); 276 278 setDOMException(state, throwScope, ec); 277 return JSValue::encode(result); 278 } 279 279 return result; 280 } 281 282 static inline JSValue jsTestTypedefsAttrWithSetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 280 283 281 284 EncodedJSValue jsTestTypedefsAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 282 285 { 283 VM& vm = state->vm(); 284 auto throwScope = DECLARE_THROW_SCOPE(vm); 285 UNUSED_PARAM(throwScope); 286 UNUSED_PARAM(thisValue); 287 JSValue decodedThisValue = JSValue::decode(thisValue); 288 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 289 if (UNLIKELY(!castedThis)) { 290 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "attrWithSetterException"); 291 } 292 auto& impl = castedThis->wrapped(); 286 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsAttrWithSetterExceptionGetter>(state, thisValue, "attrWithSetterException"); 287 } 288 289 static inline JSValue jsTestTypedefsAttrWithSetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 290 { 291 UNUSED_PARAM(throwScope); 292 UNUSED_PARAM(state); 293 auto& impl = thisObject->wrapped(); 293 294 JSValue result = jsNumber(impl.attrWithSetterException()); 294 return JSValue::encode(result); 295 } 296 295 return result; 296 } 297 298 static inline JSValue jsTestTypedefsStringAttrWithGetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 297 299 298 300 EncodedJSValue jsTestTypedefsStringAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 299 301 { 300 VM& vm = state->vm(); 301 auto throwScope = DECLARE_THROW_SCOPE(vm); 302 UNUSED_PARAM(throwScope); 303 UNUSED_PARAM(thisValue); 304 JSValue decodedThisValue = JSValue::decode(thisValue); 305 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 306 if (UNLIKELY(!castedThis)) { 307 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "stringAttrWithGetterException"); 308 } 302 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsStringAttrWithGetterExceptionGetter>(state, thisValue, "stringAttrWithGetterException"); 303 } 304 305 static inline JSValue jsTestTypedefsStringAttrWithGetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 306 { 307 UNUSED_PARAM(throwScope); 308 UNUSED_PARAM(state); 309 309 ExceptionCode ec = 0; 310 auto& impl = castedThis->wrapped();310 auto& impl = thisObject->wrapped(); 311 311 JSValue result = jsStringWithCache(state, impl.stringAttrWithGetterException(ec)); 312 312 setDOMException(state, throwScope, ec); 313 return JSValue::encode(result); 314 } 315 313 return result; 314 } 315 316 static inline JSValue jsTestTypedefsStringAttrWithSetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope); 316 317 317 318 EncodedJSValue jsTestTypedefsStringAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName) 318 319 { 319 VM& vm = state->vm(); 320 auto throwScope = DECLARE_THROW_SCOPE(vm); 321 UNUSED_PARAM(throwScope); 322 UNUSED_PARAM(thisValue); 323 JSValue decodedThisValue = JSValue::decode(thisValue); 324 auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue); 325 if (UNLIKELY(!castedThis)) { 326 return throwGetterTypeError(*state, throwScope, "TestTypedefs", "stringAttrWithSetterException"); 327 } 328 auto& impl = castedThis->wrapped(); 320 return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsStringAttrWithSetterExceptionGetter>(state, thisValue, "stringAttrWithSetterException"); 321 } 322 323 static inline JSValue jsTestTypedefsStringAttrWithSetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope) 324 { 325 UNUSED_PARAM(throwScope); 326 UNUSED_PARAM(state); 327 auto& impl = thisObject->wrapped(); 329 328 JSValue result = jsStringWithCache(state, impl.stringAttrWithSetterException()); 330 return JSValue::encode(result); 331 } 332 329 return result; 330 } 333 331 334 332 EncodedJSValue jsTestTypedefsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h
r206723 r206953 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static JSTestTypedefs* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 52 53 public: 53 54 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
r206723 r206953 133 133 } 134 134 135 inline JSattribute* JSattribute::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue) 136 { 137 return jsDynamicCast<JSattribute*>(JSValue::decode(thisValue)); 138 } 139 140 static inline JSValue jsattributeReadonlyGetter(ExecState*, JSattribute*, ThrowScope& throwScope); 141 135 142 EncodedJSValue jsattributeReadonly(ExecState* state, EncodedJSValue thisValue, PropertyName) 136 143 { 137 VM& vm = state->vm(); 138 auto throwScope = DECLARE_THROW_SCOPE(vm); 144 return BindingCaller<JSattribute>::attribute<jsattributeReadonlyGetter>(state, thisValue, "readonly"); 145 } 146 147 static inline JSValue jsattributeReadonlyGetter(ExecState* state, JSattribute* thisObject, ThrowScope& throwScope) 148 { 139 149 UNUSED_PARAM(throwScope); 140 UNUSED_PARAM(thisValue); 141 JSValue decodedThisValue = JSValue::decode(thisValue); 142 auto* castedThis = jsDynamicCast<JSattribute*>(decodedThisValue); 143 if (UNLIKELY(!castedThis)) { 144 return throwGetterTypeError(*state, throwScope, "attribute", "readonly"); 145 } 146 auto& impl = castedThis->wrapped(); 150 UNUSED_PARAM(state); 151 auto& impl = thisObject->wrapped(); 147 152 JSValue result = jsStringWithCache(state, impl.readonly()); 148 return JSValue::encode(result); 149 } 150 153 return result; 154 } 151 155 152 156 EncodedJSValue jsattributeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h
r206723 r206953 51 51 52 52 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 53 static JSattribute* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue); 53 54 public: 54 55 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
Note: See TracChangeset
for help on using the changeset viewer.