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

AbortSignal.throwIfAborted is not a function #1255

Closed
allevo opened this issue Feb 5, 2024 · 1 comment
Closed

AbortSignal.throwIfAborted is not a function #1255

allevo opened this issue Feb 5, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@allevo
Copy link

allevo commented Feb 5, 2024

Is your feature request related to a problem? Please describe.
I'm developing a plain JavaScript library that heavily uses AbortController and AbortSignal. In particular, I use the controller.signal.throwIfAborted method, but it seems not implemented in happy-dom.

Describe the solution you'd like
I want the method to be implemented.

Describe alternatives you've considered
I can manage it manually with the following code

if (controller.signal.aborted) {
  throw new Error('aborted')
}

But it isn't enjoyable.

Additional context
This feature request is compliant with the standard https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted
If you want, I can send a PR with the implementation.

@allevo allevo added the enhancement New feature or request label Feb 5, 2024
@capricorn86 capricorn86 self-assigned this Mar 17, 2024
@capricorn86
Copy link
Owner

Thank you for reporting @allevo! 🙂

Support for throwIfAborted() has been added now:
https://github.com/capricorn86/happy-dom/releases/tag/v13.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants