Bug 215501 - WritableStream rejected promises should be marked as handled as per spec
Summary: WritableStream rejected promises should be marked as handled as per spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-14 06:53 PDT by youenn fablet
Modified: 2020-08-15 09:26 PDT (History)
9 users (show)

See Also:


Attachments
Patch (11.57 KB, patch)
2020-08-14 07:48 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (10.65 KB, patch)
2020-08-15 08:53 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>