Bug 265118

Summary: NativePromise should allow void as reject type.
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: Web Template FrameworkAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Jean-Yves Avenard [:jya]
Reported 2023-11-19 19:03:56 PST
NativePromise::Result is using `Expected<T, U>` as storage type ; which doesn't allow to have U==void And as such, NativePromise must set a non-void type a RejectValueType. In bug 264028, you can now chain promises of different types together, and if you chain a void promise, that promise gets resolve whenever the original promise gets resolved, regardless of the resolve value. It would be nice to do the same for rejection. And as such, we need for NativePromise to handle RejectValueType == void. This can be achieved by using Expected<T, NativePromise::VoidPlaceholder>
Attachments
Jean-Yves Avenard [:jya]
Comment 1 2023-11-20 03:06:33 PST
Jean-Yves Avenard [:jya]
Comment 2 2023-11-20 03:07:09 PST
Jean-Yves Avenard [:jya]
Comment 3 2023-11-20 03:20:16 PST
EWS
Comment 4 2023-11-20 18:04:47 PST
Committed 270995@main (bb71e93437b5): <https://commits.webkit.org/270995@main> Reviewed commits have been landed. Closing PR #20738 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.