Changeset 267007 in webkit
- Timestamp:
- Sep 13, 2020 5:00:42 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 76 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267006 r267007 1 2020-09-13 Sam Weinig <weinig@apple.com> 2 3 [WebIDL] Remove need for [MayThrowException] on constructors and legacy factory functions 4 https://bugs.webkit.org/show_bug.cgi?id=216442 5 6 Reviewed by Darin Adler. 7 8 Deduce implementation potentially throwing by using the existing overload of 9 toJSNewlyCreated that conditionally checks for exceptions based on the return 10 type. constexpr IsExceptionOr to maintain existing optimizations around conditional 11 calls to RETURN_IF_EXCEPTION. 12 13 * bindings/scripts/CodeGeneratorJS.pm: 14 (GenerateConstructorDefinition): 15 Update code generation to output code that can handle constructors that return either 16 ExceptionOr or not. Maintain existing static assertion that the underlying return type 17 is a Ref<> using std::conditional_t predicated on IsExceptionOr and maintain the existing 18 optimization to not check for an exception after toJSNewlyCreated if one could not have 19 been made by again utilizing IsExceptionOr. 20 21 * bindings/scripts/IDLAttributes.json: 22 Remove [LegacyFactoryFunctionMayThrowException] now that it is not needed. 23 24 * Modules/applepay/ApplePaySession.idl: 25 * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: 26 * Modules/fetch/FetchHeaders.idl: 27 * Modules/fetch/FetchRequest.idl: 28 * Modules/fetch/FetchResponse.idl: 29 * Modules/mediarecorder/MediaRecorder.idl: 30 * Modules/mediastream/RTCIceCandidate.idl: 31 * Modules/mediastream/RTCPeerConnection.idl: 32 * Modules/paymentrequest/MerchantValidationEvent.idl: 33 * Modules/paymentrequest/PaymentRequest.idl: 34 * Modules/webaudio/AnalyserNode.idl: 35 * Modules/webaudio/AudioBuffer.idl: 36 * Modules/webaudio/AudioBufferSourceNode.idl: 37 * Modules/webaudio/AudioContext.idl: 38 * Modules/webaudio/BiquadFilterNode.idl: 39 * Modules/webaudio/ChannelMergerNode.idl: 40 * Modules/webaudio/ChannelSplitterNode.idl: 41 * Modules/webaudio/ConstantSourceNode.idl: 42 * Modules/webaudio/ConvolverNode.idl: 43 * Modules/webaudio/DelayNode.idl: 44 * Modules/webaudio/DynamicsCompressorNode.idl: 45 * Modules/webaudio/GainNode.idl: 46 * Modules/webaudio/IIRFilterNode.idl: 47 * Modules/webaudio/MediaElementAudioSourceNode.idl: 48 * Modules/webaudio/MediaStreamAudioDestinationNode.idl: 49 * Modules/webaudio/MediaStreamAudioSourceNode.idl: 50 * Modules/webaudio/OfflineAudioContext.idl: 51 * Modules/webaudio/OscillatorNode.idl: 52 * Modules/webaudio/PannerNode.idl: 53 * Modules/webaudio/PeriodicWave.idl: 54 * Modules/webaudio/StereoPannerNode.idl: 55 * Modules/webaudio/WaveShaperNode.idl: 56 * Modules/webaudio/WebKitAudioContext.idl: 57 * Modules/webaudio/WebKitOfflineAudioContext.idl: 58 * Modules/websockets/WebSocket.idl: 59 * Modules/webxr/WebXRRigidTransform.idl: 60 * Modules/webxr/WebXRWebGLLayer.idl: 61 * animation/KeyframeEffect.idl: 62 * css/DOMMatrix.idl: 63 * css/DOMMatrixReadOnly.idl: 64 * css/WebKitCSSMatrix.idl: 65 * dom/StaticRange.idl: 66 * dom/TextDecoder.idl: 67 * dom/TextDecoderStreamDecoder.idl: 68 * html/DOMURL.idl: 69 * html/HTMLOptionElement.h: 70 * html/HTMLOptionElement.idl: 71 * html/ImageData.idl: 72 * html/URLSearchParams.idl: 73 * html/track/TextTrackCue.idl: 74 * page/EventSource.idl: 75 * page/IntersectionObserver.idl: 76 * workers/Worker.idl: 77 Remove all uses of [LegacyFactoryFunctionMayThrowException] and [MayThrowException] 78 on constructors. 79 80 * html/HTMLAudioElement.cpp: 81 (WebCore::HTMLAudioElement::createForLegacyFactoryFunction): 82 (WebCore::HTMLAudioElement::createForJSConstructor): Deleted. 83 * html/HTMLAudioElement.h: 84 * html/HTMLImageElement.cpp: 85 (WebCore::HTMLImageElement::createForLegacyFactoryFunction): 86 (WebCore::HTMLImageElement::createForJSConstructor): Deleted. 87 * html/HTMLImageElement.h: 88 * html/HTMLOptionElement.cpp: 89 (WebCore::HTMLOptionElement::createForLegacyFactoryFunction): 90 (WebCore::HTMLOptionElement::createForJSConstructor): Deleted. 91 Renamed createForJSConstructor to createForLegacyFactoryFunction to better 92 match current WebIDL terminology. 93 94 * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp: 95 (WebCore::JSExposedToWorkerAndWindowConstructor::construct): 96 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 97 (WebCore::JSTestEventConstructorConstructor::construct): 98 * bindings/scripts/test/JS/JSTestInterface.cpp: 99 (WebCore::JSTestInterfaceConstructor::construct): 100 * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: 101 (WebCore::JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct): 102 * bindings/scripts/test/JS/JSTestNode.cpp: 103 (WebCore::JSTestNodeConstructor::construct): 104 * bindings/scripts/test/JS/JSTestObj.cpp: 105 (WebCore::JSTestObjConstructor::construct): 106 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: 107 (WebCore::constructJSTestOverloadedConstructors1): 108 (WebCore::constructJSTestOverloadedConstructors2): 109 (WebCore::constructJSTestOverloadedConstructors3): 110 (WebCore::constructJSTestOverloadedConstructors4): 111 (WebCore::constructJSTestOverloadedConstructors5): 112 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: 113 (WebCore::constructJSTestOverloadedConstructorsWithSequence1): 114 (WebCore::constructJSTestOverloadedConstructorsWithSequence2): 115 * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: 116 (WebCore::JSTestPromiseRejectionEventConstructor::construct): 117 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 118 (WebCore::JSTestTypedefsConstructor::construct): 119 * bindings/scripts/test/TestLegacyFactoryFunction.idl: 120 Update tests/expectations. 121 1 122 2020-09-13 Sam Weinig <weinig@apple.com> 2 123 -
trunk/Source/WebCore/Modules/applepay/ApplePaySession.idl
r266311 r267007 30 30 EnabledForContext, 31 31 ] interface ApplePaySession : EventTarget { 32 [CallWith=Document , MayThrowException] constructor(unsigned long version, ApplePayPaymentRequest paymentRequest);32 [CallWith=Document] constructor(unsigned long version, ApplePayPaymentRequest paymentRequest); 33 33 34 34 const unsigned short STATUS_SUCCESS = 0; -
trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl
r266360 r267007 28 28 EnabledBySetting=LegacyEncryptedMediaAPI, 29 29 ] interface WebKitMediaKeys { 30 [MayThrowException]constructor(DOMString keySystem);30 constructor(DOMString keySystem); 31 31 32 32 [CallWith=ScriptExecutionContext, MayThrowException] WebKitMediaKeySession createSession(DOMString type, Uint8Array initData); -
trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl
r266311 r267007 35 35 InterfaceName=Headers, 36 36 ] interface FetchHeaders { 37 [MayThrowException]constructor(optional HeadersInit init);37 constructor(optional HeadersInit init); 38 38 39 39 [MayThrowException] undefined append(ByteString name, ByteString value); -
trunk/Source/WebCore/Modules/fetch/FetchRequest.idl
r266523 r267007 40 40 InterfaceName=Request, 41 41 ] interface FetchRequest { 42 [CallWith=ScriptExecutionContext , MayThrowException] constructor(RequestInfo input, optional FetchRequestInit init);42 [CallWith=ScriptExecutionContext] constructor(RequestInfo input, optional FetchRequestInit init); 43 43 44 44 readonly attribute ByteString method; -
trunk/Source/WebCore/Modules/fetch/FetchResponse.idl
r266523 r267007 45 45 InterfaceName=Response, 46 46 ] interface FetchResponse { 47 [CallWith=ScriptExecutionContext , MayThrowException] constructor(optional BodyInit? body = null, optional FetchResponseInit init);47 [CallWith=ScriptExecutionContext] constructor(optional BodyInit? body = null, optional FetchResponseInit init); 48 48 49 49 [CallWith=ScriptExecutionContext, NewObject] static FetchResponse error(); -
trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.idl
r266360 r267007 31 31 Exposed=Window 32 32 ] interface MediaRecorder : EventTarget { 33 [CallWith=Document , MayThrowException] constructor(MediaStream stream, optional MediaRecorderOptions options);33 [CallWith=Document] constructor(MediaStream stream, optional MediaRecorderOptions options); 34 34 35 35 // FIXME: Implement commented out methods/attributes. -
trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl
r266698 r267007 36 36 ImplementationLacksVTable, 37 37 ] interface RTCIceCandidate { 38 [MayThrowException]constructor(RTCIceCandidateInit candidateInitDict);38 constructor(RTCIceCandidateInit candidateInitDict); 39 39 40 40 readonly attribute DOMString candidate; -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
r266662 r267007 77 77 ExportMacro=WEBCORE_EXPORT, 78 78 ] interface RTCPeerConnection : EventTarget { 79 [CallWith=Document , MayThrowException] constructor(optional RTCConfiguration configuration);79 [CallWith=Document] constructor(optional RTCConfiguration configuration); 80 80 81 81 // 4.3.2 Interface Definition -
trunk/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl
r266311 r267007 30 30 SecureContext, 31 31 ] interface MerchantValidationEvent : Event { 32 [CallWith=Document , MayThrowException] constructor(DOMString type, optional MerchantValidationEventInit eventInitDict);32 [CallWith=Document] constructor(DOMString type, optional MerchantValidationEventInit eventInitDict); 33 33 34 34 readonly attribute DOMString methodName; -
trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl
r266311 r267007 31 31 SecureContext, 32 32 ] interface PaymentRequest : EventTarget { 33 [CallWith=Document , MayThrowException] constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options);33 [CallWith=Document] constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options); 34 34 35 35 [CallWith=Document] Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise); -
trunk/Source/WebCore/Modules/webaudio/AnalyserNode.idl
r266311 r267007 27 27 JSGenerateToJSObject, 28 28 ] interface AnalyserNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional AnalyserOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional AnalyserOptions options); 30 30 31 31 attribute unsigned long fftSize; -
trunk/Source/WebCore/Modules/webaudio/AudioBuffer.idl
r266311 r267007 33 33 ReportExtraMemoryCost, 34 34 ] interface AudioBuffer { 35 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor(AudioBufferOptions options);35 [EnabledBySetting=ModernUnprefixedWebAudio] constructor(AudioBufferOptions options); 36 36 readonly attribute unsigned long length; // in sample-frames 37 37 readonly attribute double duration; // in seconds -
trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl
r266616 r267007 29 29 JSGenerateToJSObject, 30 30 ] interface AudioBufferSourceNode : AudioScheduledSourceNode { 31 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional AudioBufferSourceOptions options);31 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional AudioBufferSourceOptions options); 32 32 33 33 attribute AudioBuffer? buffer; -
trunk/Source/WebCore/Modules/webaudio/AudioContext.idl
r266311 r267007 31 31 JSGenerateToNativeObject, 32 32 ] interface AudioContext : BaseAudioContext { 33 [CallWith=Document , MayThrowException] constructor(optional AudioContextOptions contextOptions);33 [CallWith=Document] constructor(optional AudioContextOptions contextOptions); 34 34 35 35 readonly attribute double baseLatency; -
trunk/Source/WebCore/Modules/webaudio/BiquadFilterNode.idl
r266311 r267007 28 28 JSGenerateToJSObject, 29 29 ] interface BiquadFilterNode : AudioNode { 30 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional BiquadFilterOptions options);30 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional BiquadFilterOptions options); 31 31 32 32 attribute BiquadFilterType type; -
trunk/Source/WebCore/Modules/webaudio/ChannelMergerNode.idl
r265066 r267007 31 31 JSGenerateToJSObject 32 32 ] interface ChannelMergerNode : AudioNode { 33 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional ChannelMergerOptions options);33 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional ChannelMergerOptions options); 34 34 }; -
trunk/Source/WebCore/Modules/webaudio/ChannelSplitterNode.idl
r265066 r267007 27 27 JSGenerateToJSObject 28 28 ] interface ChannelSplitterNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional ChannelSplitterOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional ChannelSplitterOptions options); 30 30 }; -
trunk/Source/WebCore/Modules/webaudio/ConstantSourceNode.idl
r265689 r267007 29 29 EnabledBySetting=ModernUnprefixedWebAudio 30 30 ] interface ConstantSourceNode : AudioScheduledSourceNode { 31 [MayThrowException]constructor (BaseAudioContext context, optional ConstantSourceOptions options);31 constructor (BaseAudioContext context, optional ConstantSourceOptions options); 32 32 readonly attribute AudioParam offset; 33 33 }; -
trunk/Source/WebCore/Modules/webaudio/ConvolverNode.idl
r265298 r267007 29 29 JSGenerateToJSObject 30 30 ] interface ConvolverNode : AudioNode { 31 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional ConvolverOptions options);31 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional ConvolverOptions options); 32 32 33 33 attribute AudioBuffer? buffer; -
trunk/Source/WebCore/Modules/webaudio/DelayNode.idl
r265221 r267007 27 27 JSGenerateToJSObject 28 28 ] interface DelayNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional DelayOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional DelayOptions options); 30 30 31 31 readonly attribute AudioParam delayTime; -
trunk/Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl
r265336 r267007 28 28 JSGenerateToJSObject 29 29 ] interface DynamicsCompressorNode : AudioNode { 30 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional DynamicsCompressorOptions options);30 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional DynamicsCompressorOptions options); 31 31 32 32 readonly attribute AudioParam threshold; // in Decibels -
trunk/Source/WebCore/Modules/webaudio/GainNode.idl
r265227 r267007 27 27 JSGenerateToJSObject 28 28 ] interface GainNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional GainOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional GainOptions options); 30 30 31 31 readonly attribute AudioParam gain; -
trunk/Source/WebCore/Modules/webaudio/IIRFilterNode.idl
r266311 r267007 28 28 EnabledBySetting=ModernUnprefixedWebAudio, 29 29 ] interface IIRFilterNode : AudioNode { 30 [ MayThrowException,CallWith=ScriptExecutionContext] constructor(BaseAudioContext audioContext, IIRFilterOptions options);30 [CallWith=ScriptExecutionContext] constructor(BaseAudioContext audioContext, IIRFilterOptions options); 31 31 [MayThrowException] undefined getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse); 32 32 }; -
trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.idl
r265330 r267007 28 28 JSGenerateToJSObject 29 29 ] interface MediaElementAudioSourceNode : AudioNode { 30 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, MediaElementAudioSourceOptions options);30 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, MediaElementAudioSourceOptions options); 31 31 32 32 readonly attribute HTMLMediaElement mediaElement; -
trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.idl
r265347 r267007 27 27 JSGenerateToJSObject 28 28 ] interface MediaStreamAudioDestinationNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, optional AudioNodeOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, optional AudioNodeOptions options); 30 30 readonly attribute MediaStream stream; 31 31 }; -
trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl
r265342 r267007 27 27 JSGenerateToJSObject 28 28 ] interface MediaStreamAudioSourceNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, MediaStreamAudioSourceOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (AudioContext context, MediaStreamAudioSourceOptions options); 30 30 31 31 readonly attribute MediaStream mediaStream; -
trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.idl
r266311 r267007 28 28 JSGenerateToJSObject, 29 29 ] interface OfflineAudioContext : BaseAudioContext { 30 [CallWith=ScriptExecutionContext , MayThrowException] constructor(OfflineAudioContextOptions contextOptions);31 [CallWith=ScriptExecutionContext , MayThrowException] constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate);30 [CallWith=ScriptExecutionContext] constructor(OfflineAudioContextOptions contextOptions); 31 [CallWith=ScriptExecutionContext] constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate); 32 32 33 33 [ImplementedAs=startOfflineRendering] Promise<AudioBuffer> startRendering(); -
trunk/Source/WebCore/Modules/webaudio/OscillatorNode.idl
r266616 r267007 29 29 ActiveDOMObject, 30 30 ] interface OscillatorNode : AudioScheduledSourceNode { 31 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional OscillatorOptions options);31 [EnabledBySetting=ModernUnprefixedWebAudio] constructor (BaseAudioContext context, optional OscillatorOptions options); 32 32 33 33 attribute OscillatorType type; -
trunk/Source/WebCore/Modules/webaudio/PannerNode.idl
r266319 r267007 28 28 EnabledBySetting=ModernUnprefixedWebAudio, 29 29 ] interface PannerNode : AudioNode { 30 [MayThrowException]constructor (BaseAudioContext context, optional PannerOptions options);30 constructor (BaseAudioContext context, optional PannerOptions options); 31 31 32 32 // Default model for stereo is equalpower -
trunk/Source/WebCore/Modules/webaudio/PeriodicWave.idl
r264782 r267007 28 28 ImplementationLacksVTable 29 29 ] interface PeriodicWave { 30 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor(BaseAudioContext context, optional PeriodicWaveOptions options);30 [EnabledBySetting=ModernUnprefixedWebAudio] constructor(BaseAudioContext context, optional PeriodicWaveOptions options); 31 31 }; -
trunk/Source/WebCore/Modules/webaudio/StereoPannerNode.idl
r265962 r267007 29 29 EnabledBySetting=ModernUnprefixedWebAudio 30 30 ] interface StereoPannerNode : AudioNode { 31 [MayThrowException]constructor (BaseAudioContext context, optional StereoPannerOptions options);31 constructor (BaseAudioContext context, optional StereoPannerOptions options); 32 32 readonly attribute AudioParam pan; 33 33 }; -
trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl
r265152 r267007 27 27 JSGenerateToJSObject 28 28 ] interface WaveShaperNode : AudioNode { 29 [ MayThrowException,EnabledBySetting=ModernUnprefixedWebAudio] constructor(BaseAudioContext context, optional WaveShaperOptions options);29 [EnabledBySetting=ModernUnprefixedWebAudio] constructor(BaseAudioContext context, optional WaveShaperOptions options); 30 30 31 31 attribute Float32Array? curve; -
trunk/Source/WebCore/Modules/webaudio/WebKitAudioContext.idl
r266311 r267007 31 31 InterfaceName=webkitAudioContext, 32 32 ] interface WebKitAudioContext : EventTarget { 33 [CallWith=Document , MayThrowException] constructor();33 [CallWith=Document] constructor(); 34 34 35 35 // All rendered audio ultimately connects to destination, which represents the audio hardware. -
trunk/Source/WebCore/Modules/webaudio/WebKitOfflineAudioContext.idl
r263270 r267007 29 29 JSGenerateToJSObject, 30 30 ] interface WebKitOfflineAudioContext : WebKitAudioContext { 31 [CallWith=ScriptExecutionContext , MayThrowException] constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, unrestricted float sampleRate);31 [CallWith=ScriptExecutionContext] constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, unrestricted float sampleRate); 32 32 }; -
trunk/Source/WebCore/Modules/websockets/WebSocket.idl
r266311 r267007 35 35 EnabledAtRuntime=WebSocket 36 36 ] interface WebSocket : EventTarget { 37 [CallWith=ScriptExecutionContext , MayThrowException] constructor(USVString url, optional sequence<DOMString> protocols = []);38 [CallWith=ScriptExecutionContext , MayThrowException] constructor(USVString url, DOMString protocol);37 [CallWith=ScriptExecutionContext] constructor(USVString url, optional sequence<DOMString> protocols = []); 38 [CallWith=ScriptExecutionContext] constructor(USVString url, DOMString protocol); 39 39 40 40 readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons. -
trunk/Source/WebCore/Modules/webxr/WebXRRigidTransform.idl
r263160 r267007 32 32 InterfaceName=XRRigidTransform 33 33 ] interface WebXRRigidTransform { 34 [MayThrowException]constructor(optional DOMPointInit position, optional DOMPointInit orientation);34 constructor(optional DOMPointInit position, optional DOMPointInit orientation); 35 35 36 36 [SameObject] readonly attribute DOMPointReadOnly position; -
trunk/Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl
r263403 r267007 39 39 InterfaceName=XRWebGLLayer 40 40 ] interface WebXRWebGLLayer : WebXRLayer { 41 [MayThrowException]constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit);41 constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit); 42 42 43 43 // Attributes -
trunk/Source/WebCore/animation/KeyframeEffect.idl
r266311 r267007 31 31 JSGenerateToNativeObject, 32 32 ] interface KeyframeEffect : AnimationEffect { 33 [CallWith=GlobalObject , MayThrowException] constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options);34 [CallWith=GlobalObject , MayThrowException] constructor(KeyframeEffect source);33 [CallWith=GlobalObject] constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options); 34 [CallWith=GlobalObject] constructor(KeyframeEffect source); 35 35 36 36 attribute Element? target; -
trunk/Source/WebCore/bindings/js/JSDOMAbstractOperations.h
r266983 r267007 124 124 using ReturnType = std::invoke_result_t<Functor>; 125 125 126 if constexpr (IsExceptionOr<ReturnType> ::value) {126 if constexpr (IsExceptionOr<ReturnType>) { 127 127 auto result = functor(); 128 128 if (result.hasException()) { -
trunk/Source/WebCore/bindings/js/JSDOMConvertBase.h
r266999 r267007 95 95 template<typename T, typename U> inline JSC::JSValue toJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, U&&); 96 96 template<typename T, typename U> inline JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject&, JSDOMGlobalObject&, U&&); 97 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<IsExceptionOr<U> ::value, JSC::JSValue>;98 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<!IsExceptionOr<U> ::value, JSC::JSValue>;99 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<IsExceptionOr<U> ::value, JSC::JSValue>;100 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<!IsExceptionOr<U> ::value, JSC::JSValue>;101 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<IsExceptionOr<U> ::value, JSC::JSValue>;102 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<!IsExceptionOr<U> ::value, JSC::JSValue>;97 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<IsExceptionOr<U>, JSC::JSValue>; 98 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<!IsExceptionOr<U>, JSC::JSValue>; 99 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<IsExceptionOr<U>, JSC::JSValue>; 100 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<!IsExceptionOr<U>, JSC::JSValue>; 101 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<IsExceptionOr<U>, JSC::JSValue>; 102 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject&, JSDOMGlobalObject&, JSC::ThrowScope&, U&&) -> std::enable_if_t<!IsExceptionOr<U>, JSC::JSValue>; 103 103 104 104 template<typename T, bool needsState = JSConverter<T>::needsState, bool needsGlobalObject = JSConverter<T>::needsGlobalObject> … … 159 159 } 160 160 161 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, U&& value) -> std::enable_if_t<IsExceptionOr<U> ::value, JSC::JSValue>161 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, U&& value) -> std::enable_if_t<IsExceptionOr<U>, JSC::JSValue> 162 162 { 163 163 if (UNLIKELY(value.hasException())) { … … 169 169 } 170 170 171 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope&, U&& value) -> std::enable_if_t<!IsExceptionOr<U> ::value, JSC::JSValue>171 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope&, U&& value) -> std::enable_if_t<!IsExceptionOr<U>, JSC::JSValue> 172 172 { 173 173 return toJS<T>(lexicalGlobalObject, std::forward<U>(value)); 174 174 } 175 175 176 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, U&& value) -> std::enable_if_t<IsExceptionOr<U> ::value, JSC::JSValue>176 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, U&& value) -> std::enable_if_t<IsExceptionOr<U>, JSC::JSValue> 177 177 { 178 178 if (UNLIKELY(value.hasException())) { … … 184 184 } 185 185 186 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope&, U&& value) -> std::enable_if_t<!IsExceptionOr<U> ::value, JSC::JSValue>186 template<typename T, typename U> inline auto toJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope&, U&& value) -> std::enable_if_t<!IsExceptionOr<U>, JSC::JSValue> 187 187 { 188 188 return toJS<T>(lexicalGlobalObject, globalObject, std::forward<U>(value)); 189 189 } 190 190 191 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, U&& value) -> std::enable_if_t<IsExceptionOr<U> ::value, JSC::JSValue>191 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope& throwScope, U&& value) -> std::enable_if_t<IsExceptionOr<U>, JSC::JSValue> 192 192 { 193 193 if (UNLIKELY(value.hasException())) { … … 199 199 } 200 200 201 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope&, U&& value) -> std::enable_if_t<!IsExceptionOr<U> ::value, JSC::JSValue>201 template<typename T, typename U> inline auto toJSNewlyCreated(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, JSC::ThrowScope&, U&& value) -> std::enable_if_t<!IsExceptionOr<U>, JSC::JSValue> 202 202 { 203 203 return toJSNewlyCreated<T>(lexicalGlobalObject, globalObject, std::forward<U>(value)); -
trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.h
r266999 r267007 94 94 using ReturnType = std::invoke_result_t<Functor>; 95 95 96 if constexpr (IsExceptionOr<ReturnType> ::value) {96 if constexpr (IsExceptionOr<ReturnType>) { 97 97 auto result = functor(); 98 98 if (UNLIKELY(result.hasException())) -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r266999 r267007 7491 7491 GenerateArgumentsCountCheck($outputArray, $operation, $interface, " "); 7492 7492 7493 my $functionImplementationName = $generatingLegacyFactoryFunction ? "createFor JSConstructor" : "create";7493 my $functionImplementationName = $generatingLegacyFactoryFunction ? "createForLegacyFactoryFunction" : "create"; 7494 7494 my $functionString = GenerateParametersCheck($outputArray, $operation, $interface, $functionImplementationName, " "); 7495 7495 7496 7496 push(@$outputArray, " auto object = ${functionString};\n"); 7497 7497 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{CallWith}, "ExecState"); 7498 if ($interface->extendedAttributes->{LegacyFactoryFunctionMayThrowException} || $operation->extendedAttributes->{MayThrowException}) { 7499 push(@$outputArray, " static_assert(IsExceptionOr<decltype(object)>::value);\n"); 7500 push(@$outputArray, " static_assert(decltype(object)::ReturnType::isRef);\n"); 7501 } else { 7502 push(@$outputArray, " static_assert(decltype(object)::isRef);\n"); 7503 } 7498 7499 push(@$outputArray, " static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef);\n"); 7504 7500 7505 7501 my $IDLType = GetIDLType($interface, $interface->type); … … 7511 7507 push(@constructionConversionArguments, "*lexicalGlobalObject"); 7512 7508 push(@constructionConversionArguments, "*castedThis->globalObject()"); 7513 push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{LegacyFactoryFunctionMayThrowException} || $operation->extendedAttributes->{MayThrowException};7509 push(@constructionConversionArguments, "throwScope"); 7514 7510 push(@constructionConversionArguments, "WTFMove(object)"); 7515 7511 7516 7512 # FIXME: toJSNewlyCreated should return JSObject* instead of JSValue. 7517 7513 push(@$outputArray, " auto jsValue = toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . ");\n"); 7518 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, { });\n") if $interface->extendedAttributes->{LegacyFactoryFunctionMayThrowException} || $operation->extendedAttributes->{MayThrowException}; 7514 push(@$outputArray, " if constexpr (IsExceptionOr<decltype(object)>)\n"); 7515 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, { });\n"); 7519 7516 push(@$outputArray, " setSubclassStructureIfNeeded<${implType}>(lexicalGlobalObject, callFrame, asObject(jsValue));\n"); 7520 7517 push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, { });\n"); -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.json
r266800 r267007 317 317 "supportsConjunction": true 318 318 }, 319 "LegacyFactoryFunctionMayThrowException": {320 "contextsAllowed": ["interface"]321 },322 319 "LegacyLenientSetter": { 323 320 "contextsAllowed": ["attribute"], -
trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp
r266615 r267007 136 136 ASSERT(castedThis); 137 137 auto object = ExposedToWorkerAndWindow::create(); 138 static_assert(decltype(object)::isRef); 139 auto jsValue = toJSNewlyCreated<IDLInterface<ExposedToWorkerAndWindow>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 138 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 139 auto jsValue = toJSNewlyCreated<IDLInterface<ExposedToWorkerAndWindow>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 140 if constexpr (IsExceptionOr<decltype(object)>) 141 RETURN_IF_EXCEPTION(throwScope, { }); 140 142 setSubclassStructureIfNeeded<ExposedToWorkerAndWindow>(lexicalGlobalObject, callFrame, asObject(jsValue)); 141 143 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
r264855 r267007 181 181 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 182 182 auto object = TestEventConstructor::create(WTFMove(type), WTFMove(eventInitDict)); 183 static_assert(decltype(object)::isRef); 184 auto jsValue = toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 183 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 184 auto jsValue = toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 185 if constexpr (IsExceptionOr<decltype(object)>) 186 RETURN_IF_EXCEPTION(throwScope, { }); 185 187 setSubclassStructureIfNeeded<TestEventConstructor>(lexicalGlobalObject, callFrame, asObject(jsValue)); 186 188 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r266753 r267007 277 277 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 278 278 auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2)); 279 static_assert(IsExceptionOr<decltype(object)>::value); 280 static_assert(decltype(object)::ReturnType::isRef); 279 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 281 280 auto jsValue = toJSNewlyCreated<IDLInterface<TestInterface>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 282 RETURN_IF_EXCEPTION(throwScope, { }); 281 if constexpr (IsExceptionOr<decltype(object)>) 282 RETURN_IF_EXCEPTION(throwScope, { }); 283 283 setSubclassStructureIfNeeded<TestInterface>(lexicalGlobalObject, callFrame, asObject(jsValue)); 284 284 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp
r266649 r267007 124 124 auto str3 = argument2.value().isUndefined() ? String() : convert<IDLDOMString>(*lexicalGlobalObject, argument2.value()); 125 125 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 126 auto object = TestLegacyFactoryFunction::createForJSConstructor(document, WTFMove(str1), WTFMove(str2), WTFMove(str3)); 127 static_assert(IsExceptionOr<decltype(object)>::value); 128 static_assert(decltype(object)::ReturnType::isRef); 126 auto object = TestLegacyFactoryFunction::createForLegacyFactoryFunction(document, WTFMove(str1), WTFMove(str2), WTFMove(str3)); 127 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 129 128 auto jsValue = toJSNewlyCreated<IDLInterface<TestLegacyFactoryFunction>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 130 RETURN_IF_EXCEPTION(throwScope, { }); 129 if constexpr (IsExceptionOr<decltype(object)>) 130 RETURN_IF_EXCEPTION(throwScope, { }); 131 131 setSubclassStructureIfNeeded<TestLegacyFactoryFunction>(lexicalGlobalObject, callFrame, asObject(jsValue)); 132 132 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
r265046 r267007 116 116 ASSERT(castedThis); 117 117 auto object = TestNode::create(); 118 static_assert(decltype(object)::isRef); 119 auto jsValue = toJSNewlyCreated<IDLInterface<TestNode>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 118 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 119 auto jsValue = toJSNewlyCreated<IDLInterface<TestNode>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 120 if constexpr (IsExceptionOr<decltype(object)>) 121 RETURN_IF_EXCEPTION(throwScope, { }); 120 122 setSubclassStructureIfNeeded<TestNode>(lexicalGlobalObject, callFrame, asObject(jsValue)); 121 123 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r266662 r267007 1979 1979 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 1980 1980 auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull()); 1981 static_assert(decltype(object)::isRef); 1982 auto jsValue = toJSNewlyCreated<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 1981 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 1982 auto jsValue = toJSNewlyCreated<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 1983 if constexpr (IsExceptionOr<decltype(object)>) 1984 RETURN_IF_EXCEPTION(throwScope, { }); 1983 1985 setSubclassStructureIfNeeded<TestObj>(lexicalGlobalObject, callFrame, asObject(jsValue)); 1984 1986 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
r266753 r267007 98 98 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 99 99 auto object = TestOverloadedConstructors::create(*arrayBuffer); 100 static_assert(decltype(object)::isRef); 101 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 100 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 101 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 102 if constexpr (IsExceptionOr<decltype(object)>) 103 RETURN_IF_EXCEPTION(throwScope, { }); 102 104 setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue)); 103 105 RETURN_IF_EXCEPTION(throwScope, { }); … … 115 117 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 116 118 auto object = TestOverloadedConstructors::create(arrayBufferView.releaseNonNull()); 117 static_assert(decltype(object)::isRef); 118 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 119 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 120 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 121 if constexpr (IsExceptionOr<decltype(object)>) 122 RETURN_IF_EXCEPTION(throwScope, { }); 119 123 setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue)); 120 124 RETURN_IF_EXCEPTION(throwScope, { }); … … 132 136 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 133 137 auto object = TestOverloadedConstructors::create(*blob); 134 static_assert(decltype(object)::isRef); 135 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 138 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 139 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 140 if constexpr (IsExceptionOr<decltype(object)>) 141 RETURN_IF_EXCEPTION(throwScope, { }); 136 142 setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue)); 137 143 RETURN_IF_EXCEPTION(throwScope, { }); … … 149 155 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 150 156 auto object = TestOverloadedConstructors::create(WTFMove(string)); 151 static_assert(decltype(object)::isRef); 152 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 157 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 158 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 159 if constexpr (IsExceptionOr<decltype(object)>) 160 RETURN_IF_EXCEPTION(throwScope, { }); 153 161 setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue)); 154 162 RETURN_IF_EXCEPTION(throwScope, { }); … … 165 173 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 166 174 auto object = TestOverloadedConstructors::create(WTFMove(longArgs)); 167 static_assert(decltype(object)::isRef); 168 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 175 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 176 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 177 if constexpr (IsExceptionOr<decltype(object)>) 178 RETURN_IF_EXCEPTION(throwScope, { }); 169 179 setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue)); 170 180 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp
r264855 r267007 97 97 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 98 98 auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings)); 99 static_assert(decltype(object)::isRef); 100 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 99 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 100 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 101 if constexpr (IsExceptionOr<decltype(object)>) 102 RETURN_IF_EXCEPTION(throwScope, { }); 101 103 setSubclassStructureIfNeeded<TestOverloadedConstructorsWithSequence>(lexicalGlobalObject, callFrame, asObject(jsValue)); 102 104 RETURN_IF_EXCEPTION(throwScope, { }); … … 114 116 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 115 117 auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(string)); 116 static_assert(decltype(object)::isRef); 117 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 118 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 119 auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 120 if constexpr (IsExceptionOr<decltype(object)>) 121 RETURN_IF_EXCEPTION(throwScope, { }); 118 122 setSubclassStructureIfNeeded<TestOverloadedConstructorsWithSequence>(lexicalGlobalObject, callFrame, asObject(jsValue)); 119 123 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp
r264855 r267007 182 182 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 183 183 auto object = TestPromiseRejectionEvent::create(*castedThis->globalObject(), WTFMove(type), WTFMove(eventInitDict)); 184 static_assert(decltype(object)::isRef); 185 auto jsValue = toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 184 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 185 auto jsValue = toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 186 if constexpr (IsExceptionOr<decltype(object)>) 187 RETURN_IF_EXCEPTION(throwScope, { }); 186 188 setSubclassStructureIfNeeded<TestPromiseRejectionEvent>(lexicalGlobalObject, callFrame, asObject(jsValue)); 187 189 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r265046 r267007 173 173 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 174 174 auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull()); 175 static_assert(decltype(object)::isRef); 176 auto jsValue = toJSNewlyCreated<IDLInterface<TestTypedefs>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)); 175 static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); 176 auto jsValue = toJSNewlyCreated<IDLInterface<TestTypedefs>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); 177 if constexpr (IsExceptionOr<decltype(object)>) 178 RETURN_IF_EXCEPTION(throwScope, { }); 177 179 setSubclassStructureIfNeeded<TestTypedefs>(lexicalGlobalObject, callFrame, asObject(jsValue)); 178 180 RETURN_IF_EXCEPTION(throwScope, { }); -
trunk/Source/WebCore/bindings/scripts/test/TestLegacyFactoryFunction.idl
r266649 r267007 33 33 ActiveDOMObject, 34 34 LegacyFactoryFunction=Audio(DOMString str1, optional DOMString str2 = "defaultString", optional DOMString str3), 35 LegacyFactoryFunctionCallWith=Document, 36 LegacyFactoryFunctionMayThrowException 35 LegacyFactoryFunctionCallWith=Document 37 36 ] interface TestLegacyFactoryFunction { 38 37 }; -
trunk/Source/WebCore/css/DOMMatrix.idl
r263160 r267007 30 30 ImplementationLacksVTable 31 31 ] interface DOMMatrix : DOMMatrixReadOnly { 32 [CallWith=ScriptExecutionContext , MayThrowException] constructor(optional (DOMString or sequence<unrestricted double>) init);32 [CallWith=ScriptExecutionContext] constructor(optional (DOMString or sequence<unrestricted double>) init); 33 33 34 34 [MayThrowException, NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other); -
trunk/Source/WebCore/css/DOMMatrixReadOnly.idl
r263160 r267007 29 29 ImplementationLacksVTable 30 30 ] interface DOMMatrixReadOnly { 31 [CallWith=ScriptExecutionContext , MayThrowException] constructor(optional (DOMString or sequence<unrestricted double>) init);31 [CallWith=ScriptExecutionContext] constructor(optional (DOMString or sequence<unrestricted double>) init); 32 32 33 33 [MayThrowException, NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other); -
trunk/Source/WebCore/css/WebKitCSSMatrix.idl
r266311 r267007 28 28 ImplementationLacksVTable, 29 29 ] interface WebKitCSSMatrix { 30 [MayThrowException]constructor(optional DOMString cssValue);30 constructor(optional DOMString cssValue); 31 31 32 32 // These attributes are simple aliases for certain elements of the 4x4 matrix -
trunk/Source/WebCore/dom/ExceptionOr.h
r266999 r267007 201 201 } 202 202 203 template <typename T> struct IsExceptionOr : public std::integral_constant<bool, WTF::IsTemplate<std::decay_t<T>, ExceptionOr>::value> { }; 203 template <typename T> inline constexpr bool IsExceptionOr = WTF::IsTemplate<std::decay_t<T>, ExceptionOr>::value; 204 205 template <typename T, bool isExceptionOr = IsExceptionOr<T>> struct TypeOrExceptionOrUnderlyingTypeImpl; 206 template <typename T> struct TypeOrExceptionOrUnderlyingTypeImpl<T, true> { using Type = typename T::ReturnType; }; 207 template <typename T> struct TypeOrExceptionOrUnderlyingTypeImpl<T, false> { using Type = T; }; 208 template <typename T> using TypeOrExceptionOrUnderlyingType = typename TypeOrExceptionOrUnderlyingTypeImpl<T>::Type; 204 209 205 210 } -
trunk/Source/WebCore/dom/StaticRange.idl
r266360 r267007 29 29 Exposed=Window, 30 30 ] interface StaticRange { 31 [MayThrowException]constructor(StaticRangeInit staticRangeInitDict);31 constructor(StaticRangeInit staticRangeInitDict); 32 32 33 33 readonly attribute unsigned long startOffset; -
trunk/Source/WebCore/dom/TextDecoder.idl
r263160 r267007 37 37 ImplementationLacksVTable, 38 38 ] interface TextDecoder { 39 [MayThrowException]constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options);39 constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options); 40 40 41 41 readonly attribute DOMString encoding; -
trunk/Source/WebCore/dom/TextDecoderStreamDecoder.idl
r266609 r267007 30 30 PrivateIdentifier, 31 31 ] interface TextDecoderStreamDecoder { 32 [MayThrowException]constructor(DOMString label, boolean fatal, boolean ignoreBOM);32 constructor(DOMString label, boolean fatal, boolean ignoreBOM); 33 33 34 34 [PrivateIdentifier] DOMString encoding(); -
trunk/Source/WebCore/html/DOMURL.idl
r266311 r267007 33 33 LegacyWindowAlias=webkitURL, 34 34 ] interface DOMURL { 35 [MayThrowException]constructor(USVString url, optional USVString base);36 [MayThrowException]constructor(USVString url, DOMURL base);35 constructor(USVString url, optional USVString base); 36 constructor(USVString url, DOMURL base); 37 37 38 38 [URL] stringifier attribute USVString href; -
trunk/Source/WebCore/html/HTMLAudioElement.cpp
r246490 r267007 53 53 } 54 54 55 Ref<HTMLAudioElement> HTMLAudioElement::createFor JSConstructor(Document& document, const AtomString& src)55 Ref<HTMLAudioElement> HTMLAudioElement::createForLegacyFactoryFunction(Document& document, const AtomString& src) 56 56 { 57 57 auto element = create(audioTag, document, false); -
trunk/Source/WebCore/html/HTMLAudioElement.h
r257039 r267007 39 39 public: 40 40 static Ref<HTMLAudioElement> create(const QualifiedName&, Document&, bool); 41 static Ref<HTMLAudioElement> createFor JSConstructor(Document&, const AtomString& src);41 static Ref<HTMLAudioElement> createForLegacyFactoryFunction(Document&, const AtomString& src); 42 42 43 43 private: -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r266373 r267007 103 103 } 104 104 105 Ref<HTMLImageElement> HTMLImageElement::createFor JSConstructor(Document& document, Optional<unsigned> width, Optional<unsigned> height)105 Ref<HTMLImageElement> HTMLImageElement::createForLegacyFactoryFunction(Document& document, Optional<unsigned> width, Optional<unsigned> height) 106 106 { 107 107 auto image = adoptRef(*new HTMLImageElement(imgTag, document)); -
trunk/Source/WebCore/html/HTMLImageElement.h
r266342 r267007 51 51 static Ref<HTMLImageElement> create(Document&); 52 52 static Ref<HTMLImageElement> create(const QualifiedName&, Document&, HTMLFormElement* = nullptr); 53 static Ref<HTMLImageElement> createFor JSConstructor(Document&, Optional<unsigned> width, Optional<unsigned> height);53 static Ref<HTMLImageElement> createForLegacyFactoryFunction(Document&, Optional<unsigned> width, Optional<unsigned> height); 54 54 55 55 virtual ~HTMLImageElement(); -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r265514 r267007 70 70 } 71 71 72 ExceptionOr<Ref<HTMLOptionElement>> HTMLOptionElement::createFor JSConstructor(Document& document, const String& text, const String& value, bool defaultSelected, bool selected)72 ExceptionOr<Ref<HTMLOptionElement>> HTMLOptionElement::createForLegacyFactoryFunction(Document& document, const String& text, const String& value, bool defaultSelected, bool selected) 73 73 { 74 74 auto element = create(document); -
trunk/Source/WebCore/html/HTMLOptionElement.h
r265514 r267007 36 36 static Ref<HTMLOptionElement> create(Document&); 37 37 static Ref<HTMLOptionElement> create(const QualifiedName&, Document&); 38 static ExceptionOr<Ref<HTMLOptionElement>> createFor JSConstructor(Document&, const String& text, const String& value, bool defaultSelected, bool selected);38 static ExceptionOr<Ref<HTMLOptionElement>> createForLegacyFactoryFunction(Document&, const String& text, const String& value, bool defaultSelected, bool selected); 39 39 40 40 WEBCORE_EXPORT String text() const; -
trunk/Source/WebCore/html/HTMLOptionElement.idl
r266649 r267007 21 21 [ 22 22 JSGenerateToNativeObject, 23 LegacyFactoryFunctionMayThrowException,24 23 LegacyFactoryFunctionCallWith=Document, 25 24 LegacyFactoryFunction=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false), -
trunk/Source/WebCore/html/ImageData.idl
r263160 r267007 33 33 ImplementationLacksVTable 34 34 ] interface ImageData { 35 [MayThrowException]constructor(unsigned long sw, unsigned long sh);36 [MayThrowException]constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh);35 constructor(unsigned long sw, unsigned long sh); 36 constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh); 37 37 38 38 readonly attribute unsigned long width; -
trunk/Source/WebCore/html/URLSearchParams.idl
r266311 r267007 28 28 ImplementationLacksVTable, 29 29 ] interface URLSearchParams { 30 [MayThrowException]constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = "");30 constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""); 31 31 32 32 undefined append(USVString name, USVString value); -
trunk/Source/WebCore/html/track/TextTrackCue.idl
r266649 r267007 33 33 LegacyFactoryFunctionEnabledBySetting=GenericCueAPI 34 34 ] interface TextTrackCue : EventTarget { 35 [CallWith=Document , MayThrowException] constructor(double startTime, double endTime, DocumentFragment cueNode);35 [CallWith=Document] constructor(double startTime, double endTime, DocumentFragment cueNode); 36 36 37 37 readonly attribute TextTrack track; -
trunk/Source/WebCore/page/EventSource.idl
r266311 r267007 34 34 ActiveDOMObject, 35 35 ] interface EventSource : EventTarget { 36 [CallWith=ScriptExecutionContext , MayThrowException] constructor(USVString url, optional EventSourceInit eventSourceInitDict);36 [CallWith=ScriptExecutionContext] constructor(USVString url, optional EventSourceInit eventSourceInitDict); 37 37 38 38 readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons. -
trunk/Source/WebCore/page/IntersectionObserver.idl
r266360 r267007 31 31 EnabledBySetting=IntersectionObserver 32 32 ] interface IntersectionObserver { 33 [CallWith=Document , MayThrowException] constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options);33 [CallWith=Document] constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options); 34 34 35 35 readonly attribute Node? root; -
trunk/Source/WebCore/workers/Worker.idl
r266523 r267007 28 28 ActiveDOMObject, 29 29 ] interface Worker : EventTarget { 30 [CallWith=ScriptExecutionContext&RuntimeFlags , MayThrowException] constructor(USVString scriptUrl, optional WorkerOptions options);30 [CallWith=ScriptExecutionContext&RuntimeFlags] constructor(USVString scriptUrl, optional WorkerOptions options); 31 31 32 32 undefined terminate();
Note: See TracChangeset
for help on using the changeset viewer.