Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an AbortController instead of signaling abort on AbortSignal #1683

Merged
merged 2 commits into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3130,8 +3130,8 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Set |eventHandled| to [=a new promise=] in |workerRealm|.
1. [=Queue a task=] |task| to run the following substeps:
1. Let |e| be the result of <a>creating an event</a> with {{FetchEvent}}.
1. Let |signal| be a [=new=] {{AbortSignal}} object with |workerRealm|.
1. Let |requestObject| be the result of [=Request/creating=] a {{Request}} object, given |request|, a new {{Headers}} object's [=guard=] which is "`immutable`", |signal|, and |workerRealm|.
1. Let |controller| be a [=new=] {{AbortController}} object with |workerRealm|.
1. Let |requestObject| be the result of [=Request/creating=] a {{Request}} object, given |request|, a new {{Headers}} object's [=guard=] which is "`immutable`", |controller|'s [=AbortController/signal=], and |workerRealm|.
1. Initialize |e|’s {{Event/type}} attribute to {{fetch!!event}}.
1. Initialize |e|’s {{Event/cancelable}} attribute to true.
1. Initialize |e|’s {{FetchEvent/request}} attribute to |requestObject|.
Expand All @@ -3156,7 +3156,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. If |controller| [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>", then:
1. Let |deserializedError| be a "{{AbortError}}" {{DOMException}}.
1. If |controller|'s [=fetch controller/serialized abort reason=] is non-null, set |deserializedError| to the result of calling [$StructuredDeserialize$] with |controller|'s [=fetch controller/serialized abort reason=] and |workerRealm|. If that threw an exception or returns undefined, then set |deserializedError| to a "{{AbortError}}" {{DOMException}}.
1. [=Queue a task=] to [=AbortSignal/signal abort=] on |signal| with |deserializedError|.
1. [=Queue a task=] to [=AbortController/signal abort=] on |controller| with |deserializedError|.

If |task| is discarded, set |handleFetchFailed| to true.

Expand Down