- From: =JeffH <notifications@github.com>
- Date: Thu, 11 Nov 2021 09:05:47 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/1031/966468959@github.com>
> instead queue a task from in parallel to reject the promise
but of course, doh!
How does the below look?
Is there an approach other than a flag-based one?
```
1. Let p be a new promise.
2. If options["signal"] member is present, then:
1. Let signal be options["signal"].
2. Let abortedFlag be false.
Let algCompleteFlag be false.
3. If signal is aborted, then reject p
with signal’s abort reason and return p.
4. Add the following abort steps to signal:
1. Set abortedFlag to true.
3. Run these steps in parallel:
1. Do some amazing things, which includes checking now-and-then
for abortedFlag being true.
1. If abortedFlag is found to be true, then:
1. Queue a task on <an appropriate task source> to run the following substeps:
1. If algCompleteFlag is false, then:
1. Reject p with signal’s abort reason.
2. Abort these in-parallel steps.
2. Let amazingResult be the result of doing the amazing things.
3. Resolve p with amazingResult.
4. Set algCompleteFlag to true.
4. Return p.
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1031#issuecomment-966468959
Received on Thursday, 11 November 2021 17:06:00 UTC