Fix bug causing AbortSignal to sometimes collect too early (#16748)

This commit is contained in:
Jarred Sumner
2025-01-25 03:37:46 -08:00
committed by GitHub
parent f3b0f1fba0
commit 6367ecc7d5

View File

@@ -195,6 +195,7 @@ void AbortSignal::cleanNativeBindings(void* ref)
});
std::exchange(m_native_callbacks, WTFMove(callbacks));
this->eventListenersDidChange();
}
// https://dom.spec.whatwg.org/#abortsignal-follow
@@ -218,7 +219,7 @@ void AbortSignal::signalFollow(AbortSignal& signal)
void AbortSignal::eventListenersDidChange()
{
m_hasAbortEventListener = hasEventListeners(eventNames().abortEvent);
m_hasAbortEventListener = hasEventListeners(eventNames().abortEvent) or !m_native_callbacks.isEmpty();
}
uint32_t AbortSignal::addAbortAlgorithmToSignal(AbortSignal& signal, Ref<AbortAlgorithm>&& algorithm)