Bug 1748146 - Return early in AbortSignal::SignalAbort r=smaug

Currently only AbortSignalImpl::SignalAbort returns early. Both can be called directly, so both should return early.

Currently not really testable since this is only problematic in dom/streams and it's still hidden by a build flag.

Differential Revision: https://phabricator.services.mozilla.com/D135278
This commit is contained in:
Kagami Sascha Rosylight 2022-01-07 17:52:40 +00:00
parent bb0b1417c3
commit 182baf5159

View File

@ -152,6 +152,11 @@ void AbortSignal::ThrowIfAborted(JSContext* aCx, ErrorResult& aRv) {
// https://dom.spec.whatwg.org/#abortsignal-signal-abort
void AbortSignal::SignalAbort(JS::Handle<JS::Value> aReason) {
// Step 1, in case "signal abort" algorithm is called directly
if (Aborted()) {
return;
}
// Steps 1-4.
AbortSignalImpl::SignalAbort(aReason);