Bug 215501

Summary: WritableStream rejected promises should be marked as handled as per spec
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, benjamin, calvaris, darin, ews-watchlist, ggaren, joepeck, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description youenn fablet 2020-08-14 06:53:36 PDT
WritableStream rejected promises should be marked as handled as per spec.
Comment 1 youenn fablet 2020-08-14 07:48:31 PDT
Created attachment 406589 [details]
Patch
Comment 2 Darin Adler 2020-08-14 10:47:59 PDT
Comment on attachment 406589 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406589&action=review

> Source/WebCore/Modules/streams/WritableStreamInternals.js:72
> +        @putPromiseInternalField(readyPromiseCapability.@promise, @promiseFieldFlags, @getPromiseInternalField(readyPromiseCapability.@promise, @promiseFieldFlags) | @promiseFlagsIsHandled);

Frustrating that this long line of code is repeated 6 times. Is there a way to do this that is less wordy and repetitive, but is also still efficient?
Comment 3 youenn fablet 2020-08-14 10:52:21 PDT
Agreed, it would be nice to be able to mirror specs saying 'Set promise.[[PromiseIsHandled]] to true.'

I guess adding a builtin for that would probably not be a perf issue.
Or we could just introduce a PromiseIsHandled slot.
Any thoughts, Yusuke?
Comment 4 EWS 2020-08-15 01:00:45 PDT
Tools/Scripts/svn-apply failed to apply attachment 406589 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 5 youenn fablet 2020-08-15 01:01:20 PDT
Will land the patch and will do a follow-up for PromiseIsHandled.
Comment 6 youenn fablet 2020-08-15 08:53:30 PDT
Created attachment 406668 [details]
Patch for landing
Comment 7 EWS 2020-08-15 09:25:45 PDT
Committed r265732: <https://trac.webkit.org/changeset/265732>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406668 [details].
Comment 8 Radar WebKit Bug Importer 2020-08-15 09:26:17 PDT
<rdar://problem/67141710>