Re: [whatwg/dom] AbortController.prototype.timeout and AbortController.prototype.cancel (Issue #1039)

> On initialization of the `Request` object, "this's signal" is set to follow the `signal` passed on init _only if the init signal is provided_. If the init signal is not provided, then there is nothing that will ever trigger `this's signal`.

It sounds like it might be easier to allow "this's signal" to be `undefined` if no `init.signal` was provided. I'm not entirely sure why every request *must* have a signal, most other specs perform an "if _signal_ is present" or "if _signal_ is not null" check first. Maybe we should change this in Fetch?

> > It's possible to not have close(), as long as all operations that add an abort algorithm also remove their abort algorithm once they've completed "normally".
> 
> It's not entirely that simple. Many uses simply _can't_ remove their abort algorithms if they no longer have a handle to the algorithm itself. For instance, passing in an anonymous handler `signal.addEventListener('abort', () => { ... })`, or adding those in a different scope.

Indeed, you'd have to store a reference to the added abort algorithm somewhere, probably in an internal slot. But that's also the case for "regular" event listeners, and developers already know how to do that.

-- 
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/1039#issuecomment-989335359

Received on Thursday, 9 December 2021 00:23:25 UTC