Changeset 209153 in webkit
- Timestamp:
- Nov 30, 2016 2:10:49 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r209150 r209153 1 2016-11-29 Sam Weinig <sam@webkit.org> 2 3 [WebIDL] Add support for more missing / exotic IDLTypes 4 https://bugs.webkit.org/show_bug.cgi?id=165156 5 6 Reviewed by Alex Christensen. 7 8 - Adds JSDOMConvert support for WebIDL's 'callback interface' and 'callback function'. 9 - Adds JSDOMConvert support for WebIDL extensions for SerializedScriptValue, Dictionary, 10 EventListener and XPathNSResolver (moving much of their special casing out of perl and 11 into JSDOMConvert). 12 13 * DerivedSources.make: 14 Adds $(WebCore)/testing to the list of available IDL directories to keep internals 15 compiling. 16 17 * Modules/webaudio/WaveShaperNode.cpp: 18 * Modules/webaudio/WaveShaperNode.h: 19 Update to take curve by reference. 20 21 * bindings/generic/IDLTypes.h: 22 (WebCore::IDLWrapper): 23 Add helper type, IDLWrapper, which serves as a base type for all IDLTypes that are 24 RefCounted. 25 26 * bindings/js/JSDOMConvert.h: 27 (WebCore::convert): 28 (WebCore::Converter<IDLNullable<T>>::convert): 29 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 30 (WebCore::JSConverter<IDLCallbackFunction<T>>::convert): 31 (WebCore::JSConverter<IDLCallbackFunction<T>>::convertNewlyCreated): 32 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 33 (WebCore::JSConverter<IDLCallbackInterface<T>>::convert): 34 (WebCore::JSConverter<IDLCallbackInterface<T>>::convertNewlyCreated): 35 (WebCore::Converter<IDLSerializedScriptValue<T>>::convert): 36 (WebCore::JSConverter<IDLSerializedScriptValue<T>>::convert): 37 (WebCore::Converter<IDLLegacyDictionary<T>>::convert): 38 (WebCore::Converter<IDLEventListener<T>>::convert): 39 (WebCore::Converter<IDLXPathNSResolver<T>>::convert): 40 (WebCore::JSConverter<IDLXPathNSResolver<T>>::convert): 41 (WebCore::JSConverter<IDLXPathNSResolver<T>>::convertNewlyCreated): 42 Add converters for the new types. IDLSerializedScriptValue, IDLLegacyDictionary, IDLEventListener and IDLXPathNSResolver 43 have been templatized to avoid including their implementation classes everywhere. We can improve this in the future by 44 splitting JSDOMConvert up into to separate files. 45 46 * bindings/scripts/CodeGenerator.pm: 47 (IsBuiltinType): 48 (IsInterfaceType): 49 (IsWrapperType): 50 (ComputeIsCallbackInterface): 51 (ComputeIsCallbackFunction): 52 Add new predicates, IsBuiltinType and IsInterfaceType, and re-work IsWrapperType to determine all types that 53 have a JS wrapper (and consequently a JS{name}.h file). 54 55 * bindings/scripts/CodeGeneratorJS.pm: 56 (AddToIncludesForIDLType): 57 Update to add include for EventListener. 58 59 (GetArgumentExceptionFunction): 60 (GetArgumentExceptionThrower): 61 (GetAttributeExceptionFunction): 62 (GetAttributeExceptionThrower): 63 Add support for exceptions for callbacks. 64 65 (PassArgumentExpression): 66 Factor out logic on how to pass arguments to C++. 67 68 (GenerateHeader): 69 Make toWrapped and JSDOMWrapperConverterTraits work with XPathNSResolver. 70 71 (GenerateImplementation): 72 Update to use PassArgumentExpression and pass a global object reference to JSValueToNative. 73 74 (GenerateParametersCheck): 75 Remove special casing for callbacks. 76 77 (GenerateCallbackHeaderContent): 78 (GenerateCallbackImplementationContent): 79 Simplify toJS functions. State and global object are not necessary. 80 81 (GetBaseIDLType): 82 Add support for new types. Add assertion so that unknown types can't get through. 83 84 (ShouldPassArgumentByReference): 85 Rename from ShouldPassWrapperByReference, and merge in CodeGenerator's ShouldPassWrapperByReference. 86 87 (JSValueToNativeDOMConvertNeedsThisObject): 88 Added. Predicate to determine types that need a this object for conversion. 89 90 (JSValueToNativeDOMConvertNeedsGlobalObject): 91 Added. Predicate to determine types that need a global object for conversion. 92 93 (JSValueToNative): 94 Remove special cases for new types. 95 96 (NativeToJSValueDOMConvertNeedsState): 97 Add SerializedScriptValue and XPathNSResolver. 98 99 (NativeToJSValueDOMConvertNeedsGlobalObject): 100 Add SerializedScriptValue and XPathNSResolver. 101 102 (NativeToJSValueUsingReferences): 103 (NativeToJSValueUsingPointers): 104 (NativeToJSValue): 105 Remove unused $statePointer and replace $globalObject with $globalObjectReference. Remove 106 special cases for new types. 107 108 (GenerateConstructorDefinition): 109 Use PassArgumentExpression. 110 111 * bindings/scripts/test/JS/JSTestCallbackFunction.cpp: 112 * bindings/scripts/test/JS/JSTestCallbackFunction.h: 113 * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: 114 * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: 115 * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: 116 * bindings/scripts/test/JS/JSTestCallbackInterface.h: 117 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 118 * bindings/scripts/test/JS/JSTestObj.cpp: 119 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: 120 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 121 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 122 * bindings/scripts/test/TestObj.idl: 123 * bindings/scripts/test/TestSerializedScriptValueInterface.idl: 124 Update tests. Remove test for a readonly attribute returning a Promise, which is not supported 125 yet (this was caught by the assertion added to GetBaseIDLType). Add tests for passing and returning 126 SerializedScriptValues from functions. 127 1 128 2016-11-30 Jiewen Tan <jiewen_tan@apple.com> 2 129 -
trunk/Source/WebCore/DerivedSources.make
r209001 r209153 1291 1291 $(WebCore)/storage \ 1292 1292 $(WebCore)/svg \ 1293 $(WebCore)/testing \ 1293 1294 $(WebCore)/workers \ 1294 1295 $(WebCore)/xml -
trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp
r208688 r209153 42 42 } 43 43 44 void WaveShaperNode::setCurve(Float32Array *curve)44 void WaveShaperNode::setCurve(Float32Array& curve) 45 45 { 46 46 ASSERT(isMainThread()); 47 waveShaperProcessor()->setCurve( curve);47 waveShaperProcessor()->setCurve(&curve); 48 48 } 49 49 -
trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h
r200361 r209153 39 39 40 40 // setCurve() is called on the main thread. 41 void setCurve(Float32Array *);41 void setCurve(Float32Array&); 42 42 Float32Array* curve(); 43 43 -
trunk/Source/WebCore/bindings/generic/IDLTypes.h
r208985 r209153 38 38 39 39 namespace WebCore { 40 41 class Dictionary; 42 class EventListener; 43 class XPathNSResolver; 40 44 41 45 template <typename Value> class DOMPromise; … … 93 97 struct IDLObject : IDLUnsupportedType { }; 94 98 95 template<typename T> struct IDL Interface: IDLType<RefPtr<T>> {99 template<typename T> struct IDLWrapper : IDLType<RefPtr<T>> { 96 100 using RawType = T; 101 using NullableType = RefPtr<T>; 97 102 98 using NullableType = RefPtr<T>; 99 static std::nullptr_t nullValue() { return nullptr; } 100 static bool isNullValue(const RefPtr<T>& value) { return !value; } 101 template <typename U> static U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); } 103 static inline std::nullptr_t nullValue() { return nullptr; } 104 template<typename U> static inline bool isNullValue(U&& value) { return !value; } 105 template<typename U> static inline U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); } 102 106 }; 107 108 template<typename T> struct IDLInterface : IDLWrapper<T> { }; 109 template<typename T> struct IDLCallbackInterface : IDLWrapper<T> { }; 110 template<typename T> struct IDLCallbackFunction : IDLWrapper<T> { }; 103 111 104 112 template<typename T> struct IDLDictionary : IDLType<T> { }; 105 113 template<typename T> struct IDLEnumeration : IDLType<T> { }; 106 template<typename T> struct IDLCallbackFunction : IDLUnsupportedType { };107 114 108 115 template<typename T> struct IDLNullable : IDLType<typename T::NullableType> { … … 144 151 }; 145 152 153 template<typename T> struct IDLSerializedScriptValue : IDLWrapper<T> { }; 154 template<typename T> struct IDLLegacyDictionary : IDLType<T> { }; 155 template<typename T> struct IDLEventListener : IDLWrapper<T> { }; 156 template<typename T> struct IDLXPathNSResolver : IDLWrapper<T> { }; 157 158 159 // Non-WebIDL convenience type aliases 160 146 161 using IDLBufferSource = IDLUnion<IDLInterface<JSC::ArrayBufferView>, IDLInterface<JSC::ArrayBuffer>>; 162 147 163 148 164 // Helper predicates -
trunk/Source/WebCore/bindings/js/JSDOMConvert.h
r208985 r209153 46 46 47 47 template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue); 48 template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, JSC::JSObject&); 49 template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, JSDOMGlobalObject&); 48 50 template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, IntegerConversionConfiguration); 49 51 template<typename T> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, StringConversionConfiguration); 50 52 template<typename T, typename ExceptionThrower> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, ExceptionThrower&&); 53 template<typename T, typename ExceptionThrower> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, JSC::JSObject&, ExceptionThrower&&); 54 template<typename T, typename ExceptionThrower> typename Converter<T>::ReturnType convert(JSC::ExecState&, JSC::JSValue, JSDOMGlobalObject&, ExceptionThrower&&); 51 55 52 56 // Specialized by generated code for IDL dictionary conversion. … … 63 67 } 64 68 69 template<typename T> inline typename Converter<T>::ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSC::JSObject& thisObject) 70 { 71 return Converter<T>::convert(state, value, thisObject); 72 } 73 74 template<typename T> inline typename Converter<T>::ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSDOMGlobalObject& globalObject) 75 { 76 return Converter<T>::convert(state, value, globalObject); 77 } 78 65 79 template<typename T> inline typename Converter<T>::ReturnType convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration) 66 80 { … … 76 90 { 77 91 return Converter<T>::convert(state, value, std::forward<ExceptionThrower>(exceptionThrower)); 92 } 93 94 template<typename T, typename ExceptionThrower> inline typename Converter<T>::ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSC::JSObject& thisObject, ExceptionThrower&& exceptionThrower) 95 { 96 return Converter<T>::convert(state, value, thisObject, std::forward<ExceptionThrower>(exceptionThrower)); 97 } 98 99 template<typename T, typename ExceptionThrower> inline typename Converter<T>::ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSDOMGlobalObject& globalObject, ExceptionThrower&& exceptionThrower) 100 { 101 return Converter<T>::convert(state, value, globalObject, std::forward<ExceptionThrower>(exceptionThrower)); 78 102 } 79 103 … … 222 246 return Converter<T>::convert(state, value); 223 247 } 248 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSC::JSObject& thisObject) 249 { 250 if (value.isUndefinedOrNull()) 251 return T::nullValue(); 252 return Converter<T>::convert(state, value, thisObject); 253 } 254 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSDOMGlobalObject& globalObject) 255 { 256 if (value.isUndefinedOrNull()) 257 return T::nullValue(); 258 return Converter<T>::convert(state, value, globalObject); 259 } 224 260 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, IntegerConversionConfiguration configuration) 225 261 { … … 234 270 return Converter<T>::convert(state, value, configuration); 235 271 } 236 237 272 template<typename ExceptionThrower = DefaultExceptionThrower> 238 273 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, ExceptionThrower&& exceptionThrower) … … 241 276 return T::nullValue(); 242 277 return Converter<T>::convert(state, value, std::forward<ExceptionThrower>(exceptionThrower)); 278 } 279 template<typename ExceptionThrower = DefaultExceptionThrower> 280 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSC::JSObject& thisObject, ExceptionThrower&& exceptionThrower) 281 { 282 if (value.isUndefinedOrNull()) 283 return T::nullValue(); 284 return Converter<T>::convert(state, value, thisObject, std::forward<ExceptionThrower>(exceptionThrower)); 285 } 286 template<typename ExceptionThrower = DefaultExceptionThrower> 287 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSDOMGlobalObject& globalObject, ExceptionThrower&& exceptionThrower) 288 { 289 if (value.isUndefinedOrNull()) 290 return T::nullValue(); 291 return Converter<T>::convert(state, value, globalObject, std::forward<ExceptionThrower>(exceptionThrower)); 243 292 } 244 293 }; … … 1016 1065 { 1017 1066 return convertEnumerationToJS(exec, value); 1067 } 1068 }; 1069 1070 // MARK: - 1071 // MARK: Callback function type 1072 1073 template<typename T> struct Converter<IDLCallbackFunction<T>> : DefaultConverter<IDLCallbackFunction<T>> { 1074 template<typename ExceptionThrower = DefaultExceptionThrower> 1075 static RefPtr<T> convert(JSC::ExecState& state, JSC::JSValue value, JSDOMGlobalObject& globalObject, ExceptionThrower&& exceptionThrower = ExceptionThrower()) 1076 { 1077 JSC::VM& vm = state.vm(); 1078 auto scope = DECLARE_THROW_SCOPE(vm); 1079 1080 if (!value.isFunction()) { 1081 exceptionThrower(state, scope); 1082 return nullptr; 1083 } 1084 1085 return T::create(JSC::asObject(value), &globalObject); 1086 } 1087 }; 1088 1089 template<typename T> struct JSConverter<IDLCallbackFunction<T>> { 1090 static constexpr bool needsState = false; 1091 static constexpr bool needsGlobalObject = false; 1092 1093 template <typename U> 1094 static JSC::JSValue convert(const U& value) 1095 { 1096 return toJS(Detail::getPtrOrRef(value)); 1097 } 1098 1099 template<typename U> 1100 static JSC::JSValue convertNewlyCreated(U&& value) 1101 { 1102 return toJSNewlyCreated(std::forward<U>(value)); 1103 } 1104 }; 1105 1106 // MARK: - 1107 // MARK: Callback interface type 1108 1109 template<typename T> struct Converter<IDLCallbackInterface<T>> : DefaultConverter<IDLCallbackInterface<T>> { 1110 template<typename ExceptionThrower = DefaultExceptionThrower> 1111 static RefPtr<T> convert(JSC::ExecState& state, JSC::JSValue value, JSDOMGlobalObject& globalObject, ExceptionThrower&& exceptionThrower = ExceptionThrower()) 1112 { 1113 JSC::VM& vm = state.vm(); 1114 auto scope = DECLARE_THROW_SCOPE(vm); 1115 1116 if (!value.isObject()) { 1117 exceptionThrower(state, scope); 1118 return nullptr; 1119 } 1120 1121 return T::create(JSC::asObject(value), &globalObject); 1122 } 1123 }; 1124 1125 template<typename T> struct JSConverter<IDLCallbackInterface<T>> { 1126 static constexpr bool needsState = false; 1127 static constexpr bool needsGlobalObject = false; 1128 1129 template <typename U> 1130 static JSC::JSValue convert(const U& value) 1131 { 1132 return toJS(Detail::getPtrOrRef(value)); 1133 } 1134 1135 template<typename U> 1136 static JSC::JSValue convertNewlyCreated(U&& value) 1137 { 1138 return toJSNewlyCreated(std::forward<U>(value)); 1018 1139 } 1019 1140 }; … … 1293 1414 1294 1415 // MARK: - 1416 // MARK: SerializedScriptValue type 1417 1418 template<typename T> struct Converter<IDLSerializedScriptValue<T>> : DefaultConverter<IDLSerializedScriptValue<T>> { 1419 static RefPtr<T> convert(JSC::ExecState& state, JSC::JSValue value) 1420 { 1421 return T::create(state, value); 1422 } 1423 }; 1424 1425 template<typename T> struct JSConverter<IDLSerializedScriptValue<T>> { 1426 static constexpr bool needsState = true; 1427 static constexpr bool needsGlobalObject = true; 1428 1429 static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, RefPtr<T> value) 1430 { 1431 return value ? value->deserialize(state, &globalObject) : JSC::jsNull(); 1432 } 1433 }; 1434 1435 // MARK: - 1436 // MARK: Legacy dictionary type 1437 1438 template<typename T> struct Converter<IDLLegacyDictionary<T>> : DefaultConverter<IDLLegacyDictionary<T>> { 1439 using ReturnType = T; 1440 1441 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value) 1442 { 1443 return T(&state, value); 1444 } 1445 }; 1446 1447 // MARK: - 1448 // MARK: Event Listener type 1449 1450 template<typename T> struct Converter<IDLEventListener<T>> : DefaultConverter<IDLEventListener<T>> { 1451 using ReturnType = RefPtr<T>; 1452 1453 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, JSC::JSObject& thisObject) 1454 { 1455 auto scope = DECLARE_THROW_SCOPE(state.vm()); 1456 1457 auto listener = T::create(value, thisObject, false, currentWorld(&state)); 1458 if (!listener) 1459 throwTypeError(&state, scope); 1460 1461 return listener; 1462 } 1463 }; 1464 1465 // MARK: - 1466 // MARK: XPathNSResolver type 1467 1468 template<typename T> struct Converter<IDLXPathNSResolver<T>> : DefaultConverter<IDLXPathNSResolver<T>> { 1469 using ReturnType = RefPtr<T>; 1470 using WrapperType = typename JSDOMWrapperConverterTraits<T>::WrapperClass; 1471 1472 template<typename ExceptionThrower = DefaultExceptionThrower> 1473 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value, ExceptionThrower&& exceptionThrower = ExceptionThrower()) 1474 { 1475 JSC::VM& vm = state.vm(); 1476 auto scope = DECLARE_THROW_SCOPE(vm); 1477 ReturnType object = WrapperType::toWrapped(state, value); 1478 if (UNLIKELY(!object)) 1479 exceptionThrower(state, scope); 1480 return object; 1481 } 1482 }; 1483 1484 template<typename T> struct JSConverter<IDLXPathNSResolver<T>> { 1485 static constexpr bool needsState = true; 1486 static constexpr bool needsGlobalObject = true; 1487 1488 template <typename U> 1489 static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, const U& value) 1490 { 1491 return toJS(&state, &globalObject, Detail::getPtrOrRef(value)); 1492 } 1493 1494 template<typename U> 1495 static JSC::JSValue convertNewlyCreated(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U&& value) 1496 { 1497 return toJSNewlyCreated(&state, &globalObject, std::forward<U>(value)); 1498 } 1499 }; 1500 1501 // MARK: - 1295 1502 // MARK: Support for variadic tail convertions 1296 1503 -
trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm
r208893 r209153 92 92 ); 93 93 94 # WebCore types used directly in IDL files.95 my %webCoreTypeHash = (96 "Dictionary" => 1,97 "SerializedScriptValue" => 1,98 );99 100 94 my %dictionaryTypeImplementationNameOverrides = (); 101 95 my %enumTypeImplementationNameOverrides = (); … … 856 850 } 857 851 852 sub IsBuiltinType 853 { 854 my ($object, $type) = @_; 855 856 assert("Not a type") if ref($type) ne "IDLType"; 857 858 return 1 if $object->IsPrimitiveType($type); 859 return 1 if $object->IsSequenceOrFrozenArrayType($type); 860 return 1 if $object->IsRecordType($type); 861 return 1 if $object->IsStringType($type); 862 return 1 if $object->IsTypedArrayType($type); 863 return 1 if $type->isUnion; 864 return 1 if $type->name eq "any"; 865 return 1 if $type->name eq "BufferSource"; 866 return 1 if $type->name eq "Promise"; 867 return 1 if $type->name eq "XPathNSResolver"; 868 return 1 if $type->name eq "EventListener"; 869 return 1 if $type->name eq "Dictionary"; 870 return 1 if $type->name eq "SerializedScriptValue"; 871 872 return 0; 873 } 874 875 sub IsInterfaceType 876 { 877 my ($object, $type) = @_; 878 879 assert("Not a type") if ref($type) ne "IDLType"; 880 881 return 0 if $object->IsBuiltinType($type); 882 return 0 if $object->IsDictionaryType($type); 883 return 0 if $object->IsEnumType($type); 884 885 return 1; 886 } 887 858 888 sub IsWrapperType 859 889 { … … 862 892 assert("Not a type") if ref($type) ne "IDLType"; 863 893 864 return 0 if !$object->IsRefPtrType($type); 865 return 0 if $object->IsTypedArrayType($type); 866 return 0 if $type->name eq "BufferSource"; 867 return 0 if $webCoreTypeHash{$type->name}; 868 869 return 1; 894 return 1 if $object->IsInterfaceType($type); 895 return 1 if $type->name eq "XPathNSResolver"; 896 897 return 0; 870 898 } 871 899 … … 908 936 assert("Not a type") if ref($type) ne "IDLType"; 909 937 910 return 0 unless $object->Is WrapperType($type);938 return 0 unless $object->IsInterfaceType($type); 911 939 912 940 my $typeName = $type->name; … … 945 973 assert("Not a type") if ref($type) ne "IDLType"; 946 974 947 return 0 unless $object->Is WrapperType($type);975 return 0 unless $object->IsInterfaceType($type); 948 976 949 977 my $typeName = $type->name; … … 1093 1121 } 1094 1122 1095 sub ShouldPassWrapperByReference1096 {1097 my ($object, $argument) = @_;1098 1099 return 0 if $argument->type->isNullable;1100 return 0 if !$object->IsWrapperType($argument->type) && !$object->IsTypedArrayType($argument->type);1101 1102 return 1;1103 }1104 1123 1105 1124 1; -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r208985 r209153 279 279 return if $codeGenerator->IsStringType($type); 280 280 return if $codeGenerator->IsTypedArrayType($type); 281 return if $type->name eq "BufferSource";282 281 return if $type->name eq "any"; 283 282 … … 305 304 } 306 305 307 if ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsExternalDictionaryType($type) || $codeGenerator->IsExternalEnumType($type) ) {306 if ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsExternalDictionaryType($type) || $codeGenerator->IsExternalEnumType($type) || $type->name eq "EventListener") { 308 307 AddToIncludes("JS" . $type->name . ".h", $includesRef, $conditional); 309 308 return; … … 565 564 } 566 565 567 sub GetArgumentException Thrower566 sub GetArgumentExceptionFunction 568 567 { 569 568 my ($interface, $argument, $argumentIndex, $quotedFunctionName) = @_; 570 571 return undef if !$codeGenerator->IsWrapperType($argument->type) && !$codeGenerator->IsTypedArrayType($argument->type);572 569 573 570 my $name = $argument->name; 574 571 my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface); 575 572 my $typeName = $argument->type->name; 576 577 return "[](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, ${argumentIndex}, \"${name}\", \"${visibleInterfaceName}\", ${quotedFunctionName}, \"${typeName}\"); }" 578 } 579 580 sub GetAttributeExceptionThrower 573 574 if ($codeGenerator->IsCallbackInterface($argument->type) || $codeGenerator->IsCallbackFunction($argument->type)) { 575 # FIXME: We should have specialized messages for callback interfaces vs. callback functions. 576 return "throwArgumentMustBeFunctionError(state, scope, ${argumentIndex}, \"${name}\", \"${visibleInterfaceName}\", ${quotedFunctionName});"; 577 } 578 579 if ($codeGenerator->IsWrapperType($argument->type) || $codeGenerator->IsTypedArrayType($argument->type)) { 580 return "throwArgumentTypeError(state, scope, ${argumentIndex}, \"${name}\", \"${visibleInterfaceName}\", ${quotedFunctionName}, \"${typeName}\");"; 581 } 582 583 return undef; 584 } 585 586 sub GetArgumentExceptionThrower 587 { 588 my ($interface, $argument, $argumentIndex, $quotedFunctionName) = @_; 589 590 my $functionCall = GetArgumentExceptionFunction($interface, $argument, $argumentIndex, $quotedFunctionName); 591 return "[](JSC::ExecState& state, JSC::ThrowScope& scope) { " . $functionCall . " }" if $functionCall; 592 } 593 594 sub GetAttributeExceptionFunction 581 595 { 582 596 my ($interface, $attribute) = @_; 583 584 return undef if !$codeGenerator->IsWrapperType($attribute->type) && !$codeGenerator->IsTypedArrayType($attribute->type);585 597 586 598 my $name = $attribute->name; 587 599 my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface); 588 600 my $typeName = $attribute->type->name; 601 602 if ($codeGenerator->IsWrapperType($attribute->type) || $codeGenerator->IsTypedArrayType($attribute->type)) { 603 return "throwAttributeTypeError(state, scope, \"${visibleInterfaceName}\", \"${name}\", \"${typeName}\");"; 604 } 605 } 606 607 sub GetAttributeExceptionThrower 608 { 609 my ($interface, $attribute) = @_; 610 611 my $functionCall = GetAttributeExceptionFunction($interface, $attribute); 612 return "[](JSC::ExecState& state, JSC::ThrowScope& scope) { " . $functionCall . " }" if $functionCall; 613 614 } 615 616 sub PassArgumentExpression 617 { 618 my ($name, $context) = @_; 619 620 my $type = $context->type; 621 622 return "${name}.value()" if $codeGenerator->IsEnumType($type); 623 return "WTFMove(${name})" if $type->isNullable; 589 624 590 return "[](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, \"${visibleInterfaceName}\", \"${name}\", \"${typeName}\"); }" 625 if ($codeGenerator->IsTypedArrayType($type)) { 626 return "*${name}" if $type->name eq "ArrayBuffer"; 627 return "${name}.releaseNonNull()"; 628 } 629 630 return "${name}.releaseNonNull()" if $codeGenerator->IsCallbackInterface($type) || $codeGenerator->IsCallbackFunction($type); 631 return "*${name}" if $codeGenerator->IsWrapperType($type); 632 return "WTFMove(${name})"; 591 633 } 592 634 … … 1430 1472 if (ShouldGenerateToWrapped($hasParent, $interface)) { 1431 1473 my $nativeType = GetNativeType($interface, $interface->type); 1432 if ($interface->type->name eq "XPathNSResolver") { 1433 push(@headerContent, " static $nativeType toWrapped(JSC::ExecState&, JSC::JSValue);\n"); 1434 } else { 1435 my $export = ""; 1436 $export = "WEBCORE_EXPORT " if $interface->extendedAttributes->{ExportToWrappedFunction}; 1437 push(@headerContent, " static $export$nativeType toWrapped(JSC::JSValue);\n"); 1438 } 1474 1475 # FIXME: Add extended attribute for this. 1476 my @toWrappedArguments = (); 1477 push(@toWrappedArguments, "JSC::ExecState&") if $interface->type->name eq "XPathNSResolver"; 1478 push(@toWrappedArguments, "JSC::JSValue"); 1479 1480 my $export = ""; 1481 $export = "WEBCORE_EXPORT " if $interface->extendedAttributes->{ExportToWrappedFunction}; 1482 push(@headerContent, " static $export$nativeType toWrapped(" . join(", ", @toWrappedArguments) . ");\n"); 1439 1483 } 1440 1484 … … 1817 1861 push(@headerContent, "template<> struct JSDOMWrapperConverterTraits<${implType}> {\n"); 1818 1862 push(@headerContent, " using WrapperClass = ${className};\n"); 1819 push(@headerContent, " using ToWrappedReturnType = ${implType}*;\n");1863 push(@headerContent, " using ToWrappedReturnType = " . GetNativeType($interface, $interface->type) . ";\n"); 1820 1864 push(@headerContent, "};\n"); 1821 1865 } … … 3581 3625 } 3582 3626 3627 my $globalObjectReference = $attribute->isStatic ? "*jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())" : "*thisObject.globalObject()"; 3583 3628 my $exceptionThrower = GetAttributeExceptionThrower($interface, $attribute); 3584 3629 3585 my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute, "value", $attribute->extendedAttributes->{Conditional}, "&state", "state", "thisObject", $ exceptionThrower);3630 my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute, "value", $attribute->extendedAttributes->{Conditional}, "&state", "state", "thisObject", $globalObjectReference, $exceptionThrower); 3586 3631 3587 3632 push(@implContent, " auto nativeValue = $nativeValue;\n"); … … 3595 3640 my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); 3596 3641 3597 if ($codeGenerator->IsTypedArrayType($type) and not $type->name eq "ArrayBuffer") { 3598 push(@arguments, "nativeValue.get()"); 3599 } elsif ($codeGenerator->IsEnumType($type)) { 3600 push(@arguments, "nativeValue.value()"); 3601 } else { 3602 push(@arguments, ShouldPassWrapperByReference($attribute, $interface) ? "*nativeValue" : "WTFMove(nativeValue)"); 3603 } 3642 push(@arguments, PassArgumentExpression("nativeValue", $attribute)); 3643 3604 3644 my $implementedBy = $attribute->extendedAttributes->{ImplementedBy}; 3605 3645 if ($implementedBy) { … … 3841 3881 my $encodedName = "encoded" . $codeGenerator->WK_ucfirst($name); 3842 3882 my $nativeType = GetNativeType($interface, $argument->type); 3843 my $shouldPassByReference = ShouldPass WrapperByReference($argument, $interface);3883 my $shouldPassByReference = ShouldPassArgumentByReference($argument); 3844 3884 3845 3885 if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type))) { … … 4309 4349 my $implementedBy = $function->extendedAttributes->{ImplementedBy}; 4310 4350 my $numArguments = @{$function->arguments}; 4351 my $conditional = $function->extendedAttributes->{Conditional}; 4311 4352 4312 4353 if ($implementedBy) { 4313 AddToImplIncludes("${implementedBy}.h", $ function->extendedAttributes->{Conditional});4354 AddToImplIncludes("${implementedBy}.h", $conditional); 4314 4355 unshift(@arguments, "impl") if !$function->isStatic; 4315 4356 $functionName = "WebCore::${implementedBy}::${functionImplementationName}"; … … 4329 4370 } 4330 4371 4331 $implIncludes{"JSDOMBinding.h"} = 1;4372 AddToImplIncludes("JSDOMBinding.h", $conditional); 4332 4373 4333 4374 my $argumentIndex = 0; … … 4359 4400 my $value = $name; 4360 4401 4361 if ($codeGenerator->IsCallbackInterface($type) || $codeGenerator->IsCallbackFunction($type)) { 4362 my $callbackClassName = GetCallbackClassName($type->name); 4363 my $typeName = $type->name; 4364 $implIncludes{"$callbackClassName.h"} = 1; 4365 if ($argument->isOptional) { 4366 push(@$outputArray, " RefPtr<$typeName> $name;\n"); 4367 push(@$outputArray, " if (!state->argument($argumentIndex).isUndefinedOrNull()) {\n"); 4368 if ($codeGenerator->IsCallbackFunction($type)) { 4369 push(@$outputArray, " if (!state->uncheckedArgument($argumentIndex).isFunction())\n"); 4370 } else { 4371 push(@$outputArray, " if (!state->uncheckedArgument($argumentIndex).isObject())\n"); 4372 } 4373 push(@$outputArray, " return throwArgumentMustBeFunctionError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName);\n"); 4374 if ($function->isStatic) { 4375 AddToImplIncludes("CallbackFunction.h"); 4376 push(@$outputArray, " $name = createFunctionOnlyCallback<${callbackClassName}>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument($argumentIndex));\n"); 4377 } else { 4378 push(@$outputArray, " $name = ${callbackClassName}::create(asObject(state->uncheckedArgument($argumentIndex)), castedThis->globalObject());\n"); 4379 } 4380 push(@$outputArray, " }\n"); 4381 } else { 4382 die "CallbackInterface does not support Variadic arguments" if $argument->isVariadic; 4383 if ($codeGenerator->IsCallbackFunction($type)) { 4384 push(@$outputArray, " if (UNLIKELY(!state->uncheckedArgument($argumentIndex).isFunction()))\n"); 4385 } else { 4386 push(@$outputArray, " if (UNLIKELY(!state->uncheckedArgument($argumentIndex).isObject()))\n"); 4387 } 4388 push(@$outputArray, " return throwArgumentMustBeFunctionError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName);\n"); 4389 if ($function->isStatic) { 4390 AddToImplIncludes("CallbackFunction.h"); 4391 push(@$outputArray, " auto $name = createFunctionOnlyCallback<${callbackClassName}>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument($argumentIndex));\n"); 4392 } else { 4393 push(@$outputArray, " auto $name = ${callbackClassName}::create(asObject(state->uncheckedArgument($argumentIndex)), castedThis->globalObject());\n"); 4394 } 4395 } 4396 $value = "WTFMove($name)"; 4397 } elsif ($argument->isVariadic) { 4398 $implIncludes{"JSDOMConvert.h"} = 1; 4399 AddToImplIncludesForIDLType($type, $function->extendedAttributes->{Conditional}); 4402 if ($argument->isVariadic) { 4403 AddToImplIncludes("JSDOMConvert.h", $conditional); 4404 AddToImplIncludesForIDLType($type, $conditional); 4400 4405 4401 my $metaType = GetIDLType($interface, $type); 4402 push(@$outputArray, " auto $name = convertVariadicArguments<$metaType>(*state, $argumentIndex);\n"); 4406 my $IDLType = GetIDLType($interface, $type); 4407 4408 push(@$outputArray, " auto ${name} = convertVariadicArguments<${IDLType}>(*state, ${argumentIndex});\n"); 4403 4409 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n"); 4404 4410 4405 $value = "WTFMove($ name.arguments.value())";4411 $value = "WTFMove(${name}.arguments.value())"; 4406 4412 4407 4413 } elsif ($codeGenerator->IsEnumType($type)) { 4414 AddToImplIncludes("<runtime/Error.h>", $conditional); 4415 4408 4416 my $className = GetEnumerationClassName($type, $interface); 4409 4410 $implIncludes{"<runtime/Error.h>"} = 1;4411 4412 4417 my $nativeType = $className; 4413 4418 my $optionalValue = "optionalValue"; … … 4477 4482 $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? std::optional<$nativeType>() : "; 4478 4483 $inner = "state->uncheckedArgument($argumentIndex)"; 4479 } elsif (($argument->type->name eq "EventListener" || $argument->type->name eq "XPathNSResolver") && ($argument->isOptional || $type->isNullable)) {4480 $outer = "";4481 $inner = "state->uncheckedArgument($argumentIndex)";4482 4484 } else { 4483 4485 $outer = ""; … … 4485 4487 } 4486 4488 4489 my $globalObjectReference = $function->isStatic ? "*jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())" : "*castedThis->globalObject()"; 4487 4490 my $argumentExceptionThrower = GetArgumentExceptionThrower($interface, $argument, $argumentIndex, $quotedFunctionName); 4488 my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $inner, $function->extendedAttributes->{Conditional}, "state", "*state", "", $argumentExceptionThrower); 4489 4490 if ($argument->type->name eq "EventListener" || $argument->type->name eq "XPathNSResolver") { 4491 if ($argument->isOptional || $type->isNullable) { 4492 push(@$outputArray, " $nativeType $name = nullptr;\n"); 4493 push(@$outputArray, " if (!state->$argumentLookupMethod($argumentIndex).isUndefinedOrNull()) {\n"); 4494 push(@$outputArray, " $name = $nativeValue;\n"); 4495 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException; 4496 push(@$outputArray, " if (UNLIKELY(!$name))\n"); 4497 push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n"); 4498 push(@$outputArray, " }\n"); 4499 } else { 4500 push(@$outputArray, " auto $name = $nativeValue;\n"); 4501 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException; 4502 push(@$outputArray, " if (UNLIKELY(!$name))\n"); 4503 push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n"); 4504 } 4505 } else { 4506 push(@$outputArray, " auto $name = ${outer}${nativeValue};\n"); 4507 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException; 4508 } 4509 4510 if (ShouldPassWrapperByReference($argument, $interface)) { 4511 if ($codeGenerator->IsTypedArrayType($type) and $type->name ne "ArrayBuffer") { 4512 $value = "$name.releaseNonNull()"; 4513 } else { 4514 $value = "*$name"; 4515 } 4516 } else { 4517 $value = "WTFMove($name)"; 4518 } 4491 4492 my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $inner, $conditional, "state", "*state", "*castedThis", $globalObjectReference, $argumentExceptionThrower); 4493 4494 push(@$outputArray, " auto $name = ${outer}${nativeValue};\n"); 4495 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException; 4496 4497 $value = PassArgumentExpression($name, $argument); 4519 4498 } 4520 4499 … … 4722 4701 4723 4702 # Constructor 4724 push(@$contentRef, " $ className(JSC::JSObject* callback, JSDOMGlobalObject*);\n\n");4703 push(@$contentRef, " ${className}(JSC::JSObject*, JSDOMGlobalObject*);\n\n"); 4725 4704 4726 4705 # Private members … … 4729 4708 4730 4709 # toJS(). 4731 push(@$contentRef, "JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,${name}&);\n");4732 push(@$contentRef, "inline JSC::JSValue toJS( JSC::ExecState* state, JSDOMGlobalObject* globalObject, ${name}* impl) { return impl ? toJS(state, globalObject,*impl) : JSC::jsNull(); }\n\n");4710 push(@$contentRef, "JSC::JSValue toJS(${name}&);\n"); 4711 push(@$contentRef, "inline JSC::JSValue toJS(${name}* impl) { return impl ? toJS(*impl) : JSC::jsNull(); }\n\n"); 4733 4712 } 4734 4713 … … 4871 4850 4872 4851 # toJS() implementation. 4873 push(@$contentRef, "JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,${name}& impl)\n");4852 push(@$contentRef, "JSC::JSValue toJS(${name}& impl)\n"); 4874 4853 push(@$contentRef, "{\n"); 4875 4854 push(@$contentRef, " if (!static_cast<${className}&>(impl).callbackData())\n"); … … 5142 5121 # Non-WebIDL extensions 5143 5122 "Date" => "IDLDate", 5123 "SerializedScriptValue" => "IDLSerializedScriptValue<SerializedScriptValue>", 5124 "Dictionary" => "IDLLegacyDictionary<Dictionary>", 5125 "EventListener" => "IDLEventListener<JSEventListener>", 5126 "XPathNSResolver" => "IDLXPathNSResolver<XPathNSResolver>", 5127 5128 # Convenience type aliases 5144 5129 "BufferSource" => "IDLBufferSource", 5145 5130 ); … … 5152 5137 return "IDLRecord<" . GetIDLType($interface, @{$type->subtypes}[0]) . ", " . GetIDLType($interface, @{$type->subtypes}[1]) . ">" if $codeGenerator->IsRecordType($type); 5153 5138 return "IDLUnion<" . join(", ", GetIDLUnionMemberTypes($interface, $type)) . ">" if $type->isUnion; 5139 return "IDLCallbackFunction<" . GetCallbackClassName($type->name) . ">" if $codeGenerator->IsCallbackFunction($type); 5140 return "IDLCallbackInterface<" . GetCallbackClassName($type->name) . ">" if $codeGenerator->IsCallbackInterface($type); 5141 5142 assert("Unknown type '" . $type->name . "'.\n") unless $codeGenerator->IsInterfaceType($type) || $codeGenerator->IsTypedArrayType($type); 5154 5143 return "IDLInterface<" . $type->name . ">"; 5155 5144 } … … 5214 5203 } 5215 5204 5216 sub ShouldPassWrapperByReference 5217 { 5218 my ($parameter, $interface) = @_; 5219 5220 return 0 if $codeGenerator->IsCallbackInterface($parameter->type) || $codeGenerator->IsCallbackFunction($parameter->type); 5221 5222 my $nativeType = GetNativeType($interface, $parameter->type); 5223 return $codeGenerator->ShouldPassWrapperByReference($parameter) && (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/); 5205 sub ShouldPassArgumentByReference 5206 { 5207 my ($argument) = @_; 5208 5209 my $type = $argument->type; 5210 5211 return 0 if $type->isNullable; 5212 return 0 if $codeGenerator->IsCallbackInterface($type); 5213 return 0 if $codeGenerator->IsCallbackFunction($type); 5214 return 0 if !$codeGenerator->IsWrapperType($type) && !$codeGenerator->IsTypedArrayType($type); 5215 5216 return 1; 5224 5217 } 5225 5218 … … 5241 5234 } 5242 5235 5236 sub JSValueToNativeDOMConvertNeedsThisObject 5237 { 5238 my $type = shift; 5239 5240 return 1 if $type->name eq "EventListener"; 5241 return 0; 5242 } 5243 5244 sub JSValueToNativeDOMConvertNeedsGlobalObject 5245 { 5246 my $type = shift; 5247 5248 return 1 if $codeGenerator->IsCallbackInterface($type); 5249 return 1 if $codeGenerator->IsCallbackFunction($type); 5250 return 0; 5251 } 5252 5243 5253 sub IsValidContextForJSValueToNative 5244 5254 { … … 5252 5262 sub JSValueToNative 5253 5263 { 5254 my ($interface, $context, $value, $conditional, $statePointer, $stateReference, $thisObjectReference, $ exceptionThrower) = @_;5264 my ($interface, $context, $value, $conditional, $statePointer, $stateReference, $thisObjectReference, $globalObjectReference, $exceptionThrower) = @_; 5255 5265 5256 5266 assert("Invalid context type") if !IsValidContextForJSValueToNative($context); … … 5270 5280 } 5271 5281 5272 if ($type->name eq "SerializedScriptValue") {5273 return ("SerializedScriptValue::create($stateReference, $value)", 1);5274 }5275 5276 if ($type->name eq "Dictionary") {5277 return ("Dictionary($statePointer, $value)", 0);5278 }5279 5280 5282 if ($codeGenerator->IsEnumType($type)) { 5281 5283 return ("parseEnumeration<" . GetEnumerationClassName($type, $interface) . ">($stateReference, $value)", 1); 5282 5284 } 5283 5285 5284 # FIXME: EventListener should be a callback interface.5285 if ($type->name eq "EventListener") {5286 return ("JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))", 0);5287 }5288 5289 # FIXME: XPathNSResolver should be a callback interface.5290 if ($type->name eq "XPathNSResolver") {5291 return ("JSXPathNSResolver::toWrapped($stateReference, $value)", 1);5292 }5293 5294 5286 AddToImplIncludes("JSDOMConvert.h"); 5295 5287 … … 5297 5289 5298 5290 my @conversionArguments = (); 5299 push(@conversionArguments, "$stateReference"); 5300 push(@conversionArguments, "$value"); 5291 push(@conversionArguments, $stateReference); 5292 push(@conversionArguments, $value); 5293 push(@conversionArguments, $thisObjectReference) if JSValueToNativeDOMConvertNeedsThisObject($type); 5294 push(@conversionArguments, $globalObjectReference) if JSValueToNativeDOMConvertNeedsGlobalObject($type); 5301 5295 push(@conversionArguments, GetIntegerConversionConfiguration($context)) if $codeGenerator->IsIntegerType($type); 5302 5296 push(@conversionArguments, GetStringConversionConfiguration($context)) if $codeGenerator->IsStringType($type); … … 5356 5350 return 1 if $codeGenerator->IsStringType($type); 5357 5351 return 1 if $codeGenerator->IsEnumType($type); 5358 return 1 if $codeGenerator->Is WrapperType($type);5352 return 1 if $codeGenerator->IsInterfaceType($type); 5359 5353 return 1 if $codeGenerator->IsTypedArrayType($type); 5360 5354 return 1 if $type->name eq "Date"; 5355 return 1 if $type->name eq "SerializedScriptValue"; 5356 return 1 if $type->name eq "XPathNSResolver"; 5361 5357 5362 5358 return 0; … … 5371 5367 return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type); 5372 5368 return 1 if $codeGenerator->IsRecordType($type); 5373 return 1 if $codeGenerator->Is WrapperType($type);5369 return 1 if $codeGenerator->IsInterfaceType($type); 5374 5370 return 1 if $codeGenerator->IsTypedArrayType($type); 5371 return 1 if $type->name eq "SerializedScriptValue"; 5372 return 1 if $type->name eq "XPathNSResolver"; 5375 5373 5376 5374 return 0; … … 5380 5378 { 5381 5379 my ($context, $inFunctionCall, $interface, $value, $thisValue) = @_; 5382 my $statePointer = "&state";5383 5380 my $stateReference = "state"; 5384 5381 my $wrapped = "$thisValue.wrapped()"; 5385 my $globalObject = $thisValue ? "$thisValue.globalObject()" : "jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())";5386 5387 return NativeToJSValue($context, $inFunctionCall, $interface, $value, $state Pointer, $stateReference, $wrapped, $globalObject);5382 my $globalObjectReference = $thisValue ? "*$thisValue.globalObject()" : "*jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())"; 5383 5384 return NativeToJSValue($context, $inFunctionCall, $interface, $value, $stateReference, $wrapped, $globalObjectReference); 5388 5385 } 5389 5386 … … 5392 5389 { 5393 5390 my ($context, $inFunctionCall, $interface, $value, $thisValue) = @_; 5394 my $statePointer = "state";5395 5391 my $stateReference = "*state"; 5396 5392 my $wrapped = "$thisValue->wrapped()"; 5397 my $globalObject = $thisValue ? "$thisValue->globalObject()" : "jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())";5398 5399 return NativeToJSValue($context, $inFunctionCall, $interface, $value, $state Pointer, $stateReference, $wrapped, $globalObject);5393 my $globalObjectReference = $thisValue ? "*$thisValue->globalObject()" : "*jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())"; 5394 5395 return NativeToJSValue($context, $inFunctionCall, $interface, $value, $stateReference, $wrapped, $globalObjectReference); 5400 5396 } 5401 5397 … … 5409 5405 sub NativeToJSValue 5410 5406 { 5411 my ($context, $inFunctionCall, $interface, $value, $state Pointer, $stateReference, $wrapped, $globalObject) = @_;5407 my ($context, $inFunctionCall, $interface, $value, $stateReference, $wrapped, $globalObjectReference) = @_; 5412 5408 5413 5409 assert("Invalid context type") if !IsValidContextForNativeToJSValue($context); … … 5428 5424 if (defined $returnType and ($returnType eq "IDBKeyPath" or $returnType eq "IDBKey")) { 5429 5425 AddToImplIncludes("IDBBindingUtilities.h", $conditional); 5430 return "toJS($stateReference, *$globalObject, $value)";5426 return "toJS($stateReference, $globalObjectReference, $value)"; 5431 5427 } 5432 5428 } 5433 5429 5434 5430 AddToImplIncludesForIDLType($type, $conditional); 5435 5436 5437 if ($type->name eq "SerializedScriptValue") { 5438 return "$value ? $value->deserialize($stateReference, $globalObject) : jsNull()"; 5439 } 5431 AddToImplIncludes("JSDOMConvert.h", $conditional); 5440 5432 5441 5433 $value = "BindingSecurity::checkSecurityForNode($stateReference, $value)" if $context->extendedAttributes->{CheckSecurityForNode}; 5442 5434 5443 AddToImplIncludes("JSDOMConvert.h");5444 5445 5435 my $IDLType = GetIDLType($interface, $type); 5446 5436 5447 5437 my @conversionArguments = (); 5448 push(@conversionArguments, "$stateReference") if NativeToJSValueDOMConvertNeedsState($type) || $mayThrowException;5449 push(@conversionArguments, "*$globalObject") if NativeToJSValueDOMConvertNeedsGlobalObject($type);5438 push(@conversionArguments, $stateReference) if NativeToJSValueDOMConvertNeedsState($type) || $mayThrowException; 5439 push(@conversionArguments, $globalObjectReference) if NativeToJSValueDOMConvertNeedsGlobalObject($type); 5450 5440 push(@conversionArguments, "throwScope") if $mayThrowException; 5451 push(@conversionArguments, "$value");5441 push(@conversionArguments, $value); 5452 5442 5453 5443 my $functionName = $context->extendedAttributes->{NewObject} ? "toJSNewlyCreated" : "toJS"; … … 5893 5883 foreach my $argument (@{$function->arguments}) { 5894 5884 last if $index eq $paramIndex; 5895 if (ShouldPassWrapperByReference($argument, $interface)) { 5896 push(@constructorArgList, "*" . $argument->name); 5897 } else { 5898 push(@constructorArgList, "WTFMove(" . $argument->name . ")"); 5899 } 5885 5886 push(@constructorArgList, PassArgumentExpression($argument->name, $argument)); 5887 5900 5888 $index++; 5901 5889 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp
r208408 r209153 68 68 MarkedArgumentBuffer args; 69 69 args.append(toJS<IDLInterface<Float32Array>>(*state, *m_data->globalObject(), arrayParam)); 70 args.append( srzParam ? srzParam->deserialize(*state, m_data->globalObject()) : jsNull());70 args.append(toJS<IDLSerializedScriptValue<SerializedScriptValue>>(*state, *m_data->globalObject(), srzParam)); 71 71 args.append(toJS<IDLDOMString>(*state, strArg)); 72 72 args.append(toJS<IDLBoolean>(boolParam)); … … 81 81 } 82 82 83 JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,TestCallbackFunction& impl)83 JSC::JSValue toJS(TestCallbackFunction& impl) 84 84 { 85 85 if (!static_cast<JSTestCallbackFunction&>(impl).callbackData()) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h
r208408 r209153 46 46 47 47 private: 48 JSTestCallbackFunction(JSC::JSObject* callback, JSDOMGlobalObject*);48 JSTestCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*); 49 49 50 50 JSCallbackDataStrong* m_data; 51 51 }; 52 52 53 JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,TestCallbackFunction&);54 inline JSC::JSValue toJS( JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackFunction* impl) { return impl ? toJS(state, globalObject,*impl) : JSC::jsNull(); }53 JSC::JSValue toJS(TestCallbackFunction&); 54 inline JSC::JSValue toJS(TestCallbackFunction* impl) { return impl ? toJS(*impl) : JSC::jsNull(); } 55 55 56 56 } // namespace WebCore -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp
r208893 r209153 73 73 } 74 74 75 JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,TestCallbackFunctionWithTypedefs& impl)75 JSC::JSValue toJS(TestCallbackFunctionWithTypedefs& impl) 76 76 { 77 77 if (!static_cast<JSTestCallbackFunctionWithTypedefs&>(impl).callbackData()) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h
r208893 r209153 44 44 45 45 private: 46 JSTestCallbackFunctionWithTypedefs(JSC::JSObject* callback, JSDOMGlobalObject*);46 JSTestCallbackFunctionWithTypedefs(JSC::JSObject*, JSDOMGlobalObject*); 47 47 48 48 JSCallbackDataStrong* m_data; 49 49 }; 50 50 51 JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,TestCallbackFunctionWithTypedefs&);52 inline JSC::JSValue toJS( JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackFunctionWithTypedefs* impl) { return impl ? toJS(state, globalObject,*impl) : JSC::jsNull(); }51 JSC::JSValue toJS(TestCallbackFunctionWithTypedefs&); 52 inline JSC::JSValue toJS(TestCallbackFunctionWithTypedefs* impl) { return impl ? toJS(*impl) : JSC::jsNull(); } 53 53 54 54 } // namespace WebCore -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
r208408 r209153 143 143 ExecState* state = m_data->globalObject()->globalExec(); 144 144 MarkedArgumentBuffer args; 145 args.append( srzParam ? srzParam->deserialize(*state, m_data->globalObject()) : jsNull());145 args.append(toJS<IDLSerializedScriptValue<SerializedScriptValue>>(*state, *m_data->globalObject(), srzParam)); 146 146 args.append(toJS<IDLDOMString>(*state, strParam)); 147 147 … … 214 214 } 215 215 216 JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,TestCallbackInterface& impl)216 JSC::JSValue toJS(TestCallbackInterface& impl) 217 217 { 218 218 if (!static_cast<JSTestCallbackInterface&>(impl).callbackData()) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h
r208408 r209153 53 53 54 54 private: 55 JSTestCallbackInterface(JSC::JSObject* callback, JSDOMGlobalObject*);55 JSTestCallbackInterface(JSC::JSObject*, JSDOMGlobalObject*); 56 56 57 57 JSCallbackDataStrong* m_data; 58 58 }; 59 59 60 JSC::JSValue toJS( JSC::ExecState*, JSDOMGlobalObject*,TestCallbackInterface&);61 inline JSC::JSValue toJS( JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackInterface* impl) { return impl ? toJS(state, globalObject,*impl) : JSC::jsNull(); }60 JSC::JSValue toJS(TestCallbackInterface&); 61 inline JSC::JSValue toJS(TestCallbackInterface* impl) { return impl ? toJS(*impl) : JSC::jsNull(); } 62 62 63 63 } // namespace WebCore -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r208688 r209153 24 24 #include "JSDOMBinding.h" 25 25 #include "JSDOMConstructor.h" 26 #include "JSDOMConvert.h" 26 27 #include "JSMediaQueryListListener.h" 27 28 #include <runtime/Error.h> … … 178 179 if (UNLIKELY(state->argumentCount() < 1)) 179 180 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 180 if (UNLIKELY(!state->uncheckedArgument(0).isFunction())) 181 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "listener", "TestMediaQueryListListener", "method"); 182 auto listener = JSMediaQueryListListener::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 183 impl.method(WTFMove(listener)); 181 auto listener = convert<IDLCallbackFunction<JSMediaQueryListListener>>(*state, state->uncheckedArgument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "listener", "TestMediaQueryListListener", "method"); }); 182 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 183 impl.method(listener.releaseNonNull()); 184 184 return JSValue::encode(jsUndefined()); 185 185 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r208985 r209153 22 22 #include "JSTestObj.h" 23 23 24 #include "CallbackFunction.h"25 24 #include "Dictionary.h" 26 25 #include "Document.h" … … 41 40 #include "JSFetchRequest.h" 42 41 #include "JSNode.h" 43 #include "JSPromise.h"44 42 #include "JSSVGDocument.h" 45 43 #include "JSSVGPoint.h" … … 1273 1271 JSC::EncodedJSValue jsTestObjAttributeWithReservedEnumType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); 1274 1272 bool setJSTestObjAttributeWithReservedEnumType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); 1275 JSC::EncodedJSValue jsTestObjTestReadOnlyPromiseAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);1276 1273 JSC::EncodedJSValue jsTestObjPutForwardsAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); 1277 1274 bool setJSTestObjPutForwardsAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); … … 1420 1417 if (UNLIKELY(state->argumentCount() < 2)) 1421 1418 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 1422 if (UNLIKELY(!state->uncheckedArgument(0).isObject())) 1423 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "testCallback", "TestObject", nullptr); 1424 auto testCallback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 1425 if (UNLIKELY(!state->uncheckedArgument(1).isFunction())) 1426 return throwArgumentMustBeFunctionError(*state, throwScope, 1, "testCallbackFunction", "TestObject", nullptr); 1427 auto testCallbackFunction = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject()); 1419 auto testCallback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "testCallback", "TestObject", nullptr); }); 1420 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 1421 auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*state, state->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 1, "testCallbackFunction", "TestObject", nullptr); }); 1422 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 1428 1423 ScriptExecutionContext* context = castedThis->scriptExecutionContext(); 1429 1424 if (UNLIKELY(!context)) … … 1431 1426 ASSERT(context->isDocument()); 1432 1427 auto& document = downcast<Document>(*context); 1433 auto object = TestObj::create(document, WTFMove(testCallback), WTFMove(testCallbackFunction));1428 auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull()); 1434 1429 return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object))); 1435 1430 } … … 1565 1560 { "attribute", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, 1566 1561 { "attributeWithReservedEnumType", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithReservedEnumType) } }, 1567 { "testReadOnlyPromiseAttribute", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestReadOnlyPromiseAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },1568 1562 { "putForwardsAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsAttribute) } }, 1569 1563 { "putForwardsNullableAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsNullableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsNullableAttribute) } }, … … 3336 3330 } 3337 3331 3338 static inline JSValue jsTestObjTestReadOnlyPromiseAttributeGetter(ExecState&, JSTestObj&, ThrowScope& throwScope);3339 3340 EncodedJSValue jsTestObjTestReadOnlyPromiseAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)3341 {3342 return BindingCaller<JSTestObj>::attribute<jsTestObjTestReadOnlyPromiseAttributeGetter, CastedThisErrorBehavior::RejectPromise>(state, thisValue, "testReadOnlyPromiseAttribute");3343 }3344 3345 static inline JSValue jsTestObjTestReadOnlyPromiseAttributeGetter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope)3346 {3347 UNUSED_PARAM(throwScope);3348 UNUSED_PARAM(state);3349 auto& impl = thisObject.wrapped();3350 JSValue result = toJS<IDLInterface<Promise>>(state, *thisObject.globalObject(), impl.testReadOnlyPromiseAttribute());3351 return result;3352 }3353 3354 3332 static inline JSValue jsTestObjPutForwardsAttributeGetter(ExecState&, JSTestObj&, ThrowScope& throwScope); 3355 3333 … … 4195 4173 auto nativeValue = convert<IDLInterface<Float32Array>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "TestObject", "typedArrayAttr", "Float32Array"); }); 4196 4174 RETURN_IF_EXCEPTION(throwScope, false); 4197 impl.setTypedArrayAttr(nativeValue. get());4175 impl.setTypedArrayAttr(nativeValue.releaseNonNull()); 4198 4176 return true; 4199 4177 } … … 5257 5235 if (UNLIKELY(state->argumentCount() < 1)) 5258 5236 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 5259 auto resolver = JSXPathNSResolver::toWrapped(*state, state->uncheckedArgument(0)); 5260 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5261 if (UNLIKELY(!resolver)) 5262 return throwArgumentTypeError(*state, throwScope, 0, "resolver", "TestObject", "methodWithXPathNSResolverParameter", "XPathNSResolver"); 5237 auto resolver = convert<IDLXPathNSResolver<XPathNSResolver>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "resolver", "TestObject", "methodWithXPathNSResolverParameter", "XPathNSResolver"); }); 5238 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5263 5239 impl.methodWithXPathNSResolverParameter(*resolver); 5264 5240 return JSValue::encode(jsUndefined()); … … 5563 5539 if (UNLIKELY(state->argumentCount() < 1)) 5564 5540 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 5565 auto serializedArg = SerializedScriptValue::create(*state, state->uncheckedArgument(0));5541 auto serializedArg = convert<IDLSerializedScriptValue<SerializedScriptValue>>(*state, state->uncheckedArgument(0)); 5566 5542 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5567 5543 impl.serializedValue(WTFMove(serializedArg)); … … 5583 5559 if (UNLIKELY(state->argumentCount() < 1)) 5584 5560 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 5585 auto oo = Dictionary(state, state->uncheckedArgument(0)); 5586 auto ooo = Dictionary(state, state->argument(1)); 5561 auto oo = convert<IDLLegacyDictionary<Dictionary>>(*state, state->uncheckedArgument(0)); 5562 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5563 auto ooo = convert<IDLLegacyDictionary<Dictionary>>(*state, state->argument(1)); 5564 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5587 5565 impl.optionsObject(WTFMove(oo), WTFMove(ooo)); 5588 5566 return JSValue::encode(jsUndefined()); … … 5737 5715 auto type = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal); 5738 5716 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5739 auto listener = JSEventListener::create(state->uncheckedArgument(1), *castedThis, false, currentWorld(state)); 5740 if (UNLIKELY(!listener)) 5741 return throwArgumentTypeError(*state, throwScope, 1, "listener", "TestObject", "addEventListener", "EventListener"); 5717 auto listener = convert<IDLEventListener<JSEventListener>>(*state, state->uncheckedArgument(1), *castedThis); 5718 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5742 5719 auto useCapture = convert<IDLBoolean>(*state, state->argument(2)); 5743 5720 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5744 impl.addEventListener(WTFMove(type), *listener, WTFMove(useCapture));5721 impl.addEventListener(WTFMove(type), WTFMove(listener), WTFMove(useCapture)); 5745 5722 return JSValue::encode(jsUndefined()); 5746 5723 } … … 5762 5739 auto type = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal); 5763 5740 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5764 auto listener = JSEventListener::create(state->uncheckedArgument(1), *castedThis, false, currentWorld(state)); 5765 if (UNLIKELY(!listener)) 5766 return throwArgumentTypeError(*state, throwScope, 1, "listener", "TestObject", "removeEventListener", "EventListener"); 5741 auto listener = convert<IDLEventListener<JSEventListener>>(*state, state->uncheckedArgument(1), *castedThis); 5742 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5767 5743 auto useCapture = convert<IDLBoolean>(*state, state->argument(2)); 5768 5744 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 5769 impl.removeEventListener(WTFMove(type), *listener, WTFMove(useCapture));5745 impl.removeEventListener(WTFMove(type), WTFMove(listener), WTFMove(useCapture)); 5770 5746 return JSValue::encode(jsUndefined()); 5771 5747 } … … 6506 6482 UNUSED_PARAM(throwScope); 6507 6483 auto& impl = castedThis->wrapped(); 6508 RefPtr<XPathNSResolver> resolver = nullptr; 6509 if (!state->argument(0).isUndefinedOrNull()) { 6510 resolver = JSXPathNSResolver::toWrapped(*state, state->uncheckedArgument(0)); 6511 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6512 if (UNLIKELY(!resolver)) 6513 return throwArgumentTypeError(*state, throwScope, 0, "resolver", "TestObject", "methodWithOptionalXPathNSResolver", "XPathNSResolver"); 6514 } 6484 auto resolver = convert<IDLNullable<IDLXPathNSResolver<XPathNSResolver>>>(*state, state->argument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "resolver", "TestObject", "methodWithOptionalXPathNSResolver", "XPathNSResolver"); }); 6485 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6515 6486 impl.methodWithOptionalXPathNSResolver(WTFMove(resolver)); 6516 6487 return JSValue::encode(jsUndefined()); … … 6549 6520 if (UNLIKELY(state->argumentCount() < 1)) 6550 6521 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 6551 if (UNLIKELY(!state->uncheckedArgument(0).isObject())) 6552 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "methodWithCallbackArg"); 6553 auto callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 6554 impl.methodWithCallbackArg(WTFMove(callback)); 6522 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "methodWithCallbackArg"); }); 6523 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6524 impl.methodWithCallbackArg(callback.releaseNonNull()); 6555 6525 return JSValue::encode(jsUndefined()); 6556 6526 } … … 6572 6542 auto nonCallback = convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal); 6573 6543 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6574 if (UNLIKELY(!state->uncheckedArgument(1).isObject())) 6575 return throwArgumentMustBeFunctionError(*state, throwScope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackArg"); 6576 auto callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject()); 6577 impl.methodWithNonCallbackArgAndCallbackArg(WTFMove(nonCallback), WTFMove(callback)); 6544 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackArg"); }); 6545 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6546 impl.methodWithNonCallbackArgAndCallbackArg(WTFMove(nonCallback), callback.releaseNonNull()); 6578 6547 return JSValue::encode(jsUndefined()); 6579 6548 } … … 6591 6560 UNUSED_PARAM(throwScope); 6592 6561 auto& impl = castedThis->wrapped(); 6593 RefPtr<TestCallbackInterface> callback; 6594 if (!state->argument(0).isUndefinedOrNull()) { 6595 if (!state->uncheckedArgument(0).isObject()) 6596 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "methodWithCallbackAndOptionalArg"); 6597 callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 6598 } 6562 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*state, state->argument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "methodWithCallbackAndOptionalArg"); }); 6563 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6599 6564 impl.methodWithCallbackAndOptionalArg(WTFMove(callback)); 6600 6565 return JSValue::encode(jsUndefined()); … … 6615 6580 if (UNLIKELY(state->argumentCount() < 1)) 6616 6581 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 6617 if (UNLIKELY(!state->uncheckedArgument(0).isFunction())) 6618 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "methodWithCallbackFunctionArg"); 6619 auto callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 6620 impl.methodWithCallbackFunctionArg(WTFMove(callback)); 6582 auto callback = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*state, state->uncheckedArgument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "methodWithCallbackFunctionArg"); }); 6583 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6584 impl.methodWithCallbackFunctionArg(callback.releaseNonNull()); 6621 6585 return JSValue::encode(jsUndefined()); 6622 6586 } … … 6638 6602 auto nonCallback = convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal); 6639 6603 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6640 if (UNLIKELY(!state->uncheckedArgument(1).isFunction())) 6641 return throwArgumentMustBeFunctionError(*state, throwScope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackFunctionArg"); 6642 auto callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject()); 6643 impl.methodWithNonCallbackArgAndCallbackFunctionArg(WTFMove(nonCallback), WTFMove(callback)); 6604 auto callback = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*state, state->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackFunctionArg"); }); 6605 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6606 impl.methodWithNonCallbackArgAndCallbackFunctionArg(WTFMove(nonCallback), callback.releaseNonNull()); 6644 6607 return JSValue::encode(jsUndefined()); 6645 6608 } … … 6657 6620 UNUSED_PARAM(throwScope); 6658 6621 auto& impl = castedThis->wrapped(); 6659 RefPtr<TestCallbackFunction> callback; 6660 if (!state->argument(0).isUndefinedOrNull()) { 6661 if (!state->uncheckedArgument(0).isFunction()) 6662 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "methodWithCallbackFunctionAndOptionalArg"); 6663 callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 6664 } 6622 auto callback = convert<IDLNullable<IDLCallbackFunction<JSTestCallbackFunction>>>(*state, state->argument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "methodWithCallbackFunctionAndOptionalArg"); }); 6623 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6665 6624 impl.methodWithCallbackFunctionAndOptionalArg(WTFMove(callback)); 6666 6625 return JSValue::encode(jsUndefined()); … … 6672 6631 auto throwScope = DECLARE_THROW_SCOPE(vm); 6673 6632 UNUSED_PARAM(throwScope); 6674 RefPtr<TestCallbackInterface> callback; 6675 if (!state->argument(0).isUndefinedOrNull()) { 6676 if (!state->uncheckedArgument(0).isObject()) 6677 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "staticMethodWithCallbackAndOptionalArg"); 6678 callback = createFunctionOnlyCallback<JSTestCallbackInterface>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0)); 6679 } 6633 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*state, state->argument(0), *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "staticMethodWithCallbackAndOptionalArg"); }); 6634 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6680 6635 TestObj::staticMethodWithCallbackAndOptionalArg(WTFMove(callback)); 6681 6636 return JSValue::encode(jsUndefined()); … … 6689 6644 if (UNLIKELY(state->argumentCount() < 1)) 6690 6645 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 6691 if (UNLIKELY(!state->uncheckedArgument(0).isObject())) 6692 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "staticMethodWithCallbackArg"); 6693 auto callback = createFunctionOnlyCallback<JSTestCallbackInterface>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0)); 6694 TestObj::staticMethodWithCallbackArg(WTFMove(callback)); 6646 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(0), *jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "staticMethodWithCallbackArg"); }); 6647 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6648 TestObj::staticMethodWithCallbackArg(callback.releaseNonNull()); 6695 6649 return JSValue::encode(jsUndefined()); 6696 6650 } … … 6850 6804 if (UNLIKELY(state->argumentCount() < 1)) 6851 6805 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 6852 if (UNLIKELY(!state->uncheckedArgument(0).isObject())) 6853 return throwArgumentMustBeFunctionError(*state, throwScope, 0, "callback", "TestObject", "overloadedMethod"); 6854 auto callback = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject()); 6855 impl.overloadedMethod(WTFMove(callback)); 6806 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(0), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 0, "callback", "TestObject", "overloadedMethod"); }); 6807 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6808 impl.overloadedMethod(callback.releaseNonNull()); 6856 6809 return JSValue::encode(jsUndefined()); 6857 6810 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
r208688 r209153 92 92 auto arrayBufferView = convert<IDLInterface<ArrayBufferView>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView"); }); 93 93 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 94 auto object = TestOverloadedConstructors::create( *arrayBufferView);94 auto object = TestOverloadedConstructors::create(arrayBufferView.releaseNonNull()); 95 95 return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object))); 96 96 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r208613 r209153 30 30 #include "JSMessagePort.h" 31 31 #include "SerializedScriptValue.h" 32 #include <runtime/Error.h> 32 33 #include <runtime/FunctionPrototype.h> 33 34 #include <runtime/JSArray.h> … … 37 38 38 39 namespace WebCore { 40 41 // Functions 42 43 JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunction(JSC::ExecState*); 44 JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning(JSC::ExecState*); 39 45 40 46 // Attributes … … 102 108 { "ports", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfacePorts), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, 103 109 { "cachedReadonlyValue", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceCachedReadonlyValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, 110 { "function", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestSerializedScriptValueInterfacePrototypeFunctionFunction), (intptr_t) (1) } }, 111 { "functionReturning", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning), (intptr_t) (0) } }, 104 112 }; 105 113 … … 147 155 } 148 156 157 template<> inline JSTestSerializedScriptValueInterface* BindingCaller<JSTestSerializedScriptValueInterface>::castForOperation(ExecState& state) 158 { 159 return jsDynamicDowncast<JSTestSerializedScriptValueInterface*>(state.thisValue()); 160 } 161 149 162 static inline JSValue jsTestSerializedScriptValueInterfaceValueGetter(ExecState&, JSTestSerializedScriptValueInterface&, ThrowScope& throwScope); 150 163 … … 159 172 UNUSED_PARAM(state); 160 173 auto& impl = thisObject.wrapped(); 161 JSValue result = impl.value() ? impl.value()->deserialize(state, thisObject.globalObject()) : jsNull();174 JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.value()); 162 175 return result; 163 176 } … … 175 188 UNUSED_PARAM(state); 176 189 auto& impl = thisObject.wrapped(); 177 JSValue result = impl.readonlyValue() ? impl.readonlyValue()->deserialize(state, thisObject.globalObject()) : jsNull();190 JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.readonlyValue()); 178 191 return result; 179 192 } … … 193 206 return cachedValue; 194 207 auto& impl = thisObject.wrapped(); 195 JSValue result = impl.cachedValue() ? impl.cachedValue()->deserialize(state, thisObject.globalObject()) : jsNull();208 JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.cachedValue()); 196 209 thisObject.m_cachedValue.set(state.vm(), &thisObject, result); 197 210 return result; … … 228 241 return cachedValue; 229 242 auto& impl = thisObject.wrapped(); 230 JSValue result = impl.cachedReadonlyValue() ? impl.cachedReadonlyValue()->deserialize(state, thisObject.globalObject()) : jsNull();243 JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.cachedReadonlyValue()); 231 244 thisObject.m_cachedReadonlyValue.set(state.vm(), &thisObject, result); 232 245 return result; … … 269 282 UNUSED_PARAM(throwScope); 270 283 auto& impl = thisObject.wrapped(); 271 auto nativeValue = SerializedScriptValue::create(state, value);284 auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value); 272 285 RETURN_IF_EXCEPTION(throwScope, false); 273 286 impl.setValue(WTFMove(nativeValue)); … … 288 301 UNUSED_PARAM(throwScope); 289 302 auto& impl = thisObject.wrapped(); 290 auto nativeValue = SerializedScriptValue::create(state, value);303 auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value); 291 304 RETURN_IF_EXCEPTION(throwScope, false); 292 305 impl.setCachedValue(WTFMove(nativeValue)); … … 298 311 { 299 312 return getDOMConstructor<JSTestSerializedScriptValueInterfaceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); 313 } 314 315 static inline JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionCaller(JSC::ExecState*, JSTestSerializedScriptValueInterface*, JSC::ThrowScope&); 316 317 EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunction(ExecState* state) 318 { 319 return BindingCaller<JSTestSerializedScriptValueInterface>::callOperation<jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionCaller>(state, "function"); 320 } 321 322 static inline JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionCaller(JSC::ExecState* state, JSTestSerializedScriptValueInterface* castedThis, JSC::ThrowScope& throwScope) 323 { 324 UNUSED_PARAM(state); 325 UNUSED_PARAM(throwScope); 326 auto& impl = castedThis->wrapped(); 327 if (UNLIKELY(state->argumentCount() < 1)) 328 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 329 auto value = convert<IDLSerializedScriptValue<SerializedScriptValue>>(*state, state->uncheckedArgument(0)); 330 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 331 impl.function(WTFMove(value)); 332 return JSValue::encode(jsUndefined()); 333 } 334 335 static inline JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningCaller(JSC::ExecState*, JSTestSerializedScriptValueInterface*, JSC::ThrowScope&); 336 337 EncodedJSValue JSC_HOST_CALL jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning(ExecState* state) 338 { 339 return BindingCaller<JSTestSerializedScriptValueInterface>::callOperation<jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningCaller>(state, "functionReturning"); 340 } 341 342 static inline JSC::EncodedJSValue jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningCaller(JSC::ExecState* state, JSTestSerializedScriptValueInterface* castedThis, JSC::ThrowScope& throwScope) 343 { 344 UNUSED_PARAM(state); 345 UNUSED_PARAM(throwScope); 346 auto& impl = castedThis->wrapped(); 347 return JSValue::encode(toJS<IDLSerializedScriptValue<SerializedScriptValue>>(*state, *castedThis->globalObject(), impl.functionReturning())); 300 348 } 301 349 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r208985 r209153 135 135 auto hello = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal); 136 136 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 137 if (UNLIKELY(!state->uncheckedArgument(1).isFunction())) 138 return throwArgumentMustBeFunctionError(*state, throwScope, 1, "testCallbackFunction", "TestTypedefs", nullptr); 139 auto testCallbackFunction = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject()); 140 if (UNLIKELY(!state->uncheckedArgument(2).isObject())) 141 return throwArgumentMustBeFunctionError(*state, throwScope, 2, "testCallbackInterface", "TestTypedefs", nullptr); 142 auto testCallbackInterface = JSTestCallbackInterface::create(asObject(state->uncheckedArgument(2)), castedThis->globalObject()); 143 auto object = TestTypedefs::create(WTFMove(hello), WTFMove(testCallbackFunction), WTFMove(testCallbackInterface)); 137 auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*state, state->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 1, "testCallbackFunction", "TestTypedefs", nullptr); }); 138 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 139 auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(2), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); }); 140 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 141 auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull()); 144 142 return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object))); 145 143 } … … 264 262 UNUSED_PARAM(state); 265 263 auto& impl = thisObject.wrapped(); 266 JSValue result = impl.immutableSerializedScriptValue() ? impl.immutableSerializedScriptValue()->deserialize(state, thisObject.globalObject()) : jsNull();264 JSValue result = toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, *thisObject.globalObject(), impl.immutableSerializedScriptValue()); 267 265 return result; 268 266 } … … 401 399 UNUSED_PARAM(throwScope); 402 400 auto& impl = thisObject.wrapped(); 403 auto nativeValue = SerializedScriptValue::create(state, value);401 auto nativeValue = convert<IDLSerializedScriptValue<SerializedScriptValue>>(state, value); 404 402 RETURN_IF_EXCEPTION(throwScope, false); 405 403 impl.setImmutableSerializedScriptValue(WTFMove(nativeValue)); … … 549 547 if (UNLIKELY(state->argumentCount() < 1)) 550 548 return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); 551 auto sequenceArg = convert<IDLSequence<IDL Interface<SerializedScriptValue>>>(*state, state->uncheckedArgument(0));549 auto sequenceArg = convert<IDLSequence<IDLSerializedScriptValue<SerializedScriptValue>>>(*state, state->uncheckedArgument(0)); 552 550 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 553 551 return JSValue::encode(toJS<IDLUnsignedLongLong>(impl.methodWithSequenceArg(WTFMove(sequenceArg)))); -
trunk/Source/WebCore/bindings/scripts/test/TestObj.idl
r208893 r209153 392 392 void _any(unrestricted float a, long b); 393 393 394 395 readonly attribute Promise<void> testReadOnlyPromiseAttribute; 394 // FIXME: Add support for Promise attributes. 395 // readonly attribute Promise<void> testReadOnlyPromiseAttribute; 396 396 397 // Promise function 397 398 Promise<void> testPromiseFunction(); -
trunk/Source/WebCore/bindings/scripts/test/TestSerializedScriptValueInterface.idl
r204336 r209153 25 25 26 26 // This IDL file is for testing the bindings code generator and for tracking 27 // changes in its ou put.27 // changes in its output. 28 28 [ 29 29 Conditional=Condition1|Condition2, … … 34 34 readonly attribute sequence<MessagePort> ports; 35 35 [CachedAttribute] readonly attribute SerializedScriptValue cachedReadonlyValue; 36 void function(SerializedScriptValue value); 37 SerializedScriptValue functionReturning(); 36 38 };
Note: See TracChangeset
for help on using the changeset viewer.