-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(ext/web): add AbortSignal.any()
#21087
Conversation
@crowlKats please take a look |
} | ||
|
||
[remove](algorithm) { | ||
this[abortAlgos] && SetPrototypeDelete(this[abortAlgos], algorithm); | ||
} | ||
|
||
constructor(key = null) { | ||
if (key != illegalConstructorKey) { | ||
if (key !== illegalConstructorKey) { | ||
throw new TypeError("Illegal constructor."); | ||
} | ||
super(); | ||
this[abortReason] = undefined; | ||
this[abortAlgos] = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is currently supposed to be an empty set on construction, see https://dom.spec.whatwg.org/#abortsignal-abort-algorithms. That should also cascade on a bunch of "null-check plus re-initialization" which may be redundant now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done for performance reasons in #12165, though not sure how ideal this is. I wouldn't worry about this though as it works as expected.
throw new TypeError("Illegal constructor."); | ||
} | ||
super(); | ||
this[abortReason] = undefined; | ||
this[abortAlgos] = null; | ||
this[dependent] = false; | ||
this[sourceSignals] = null; | ||
this[dependentSignals] = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the specs these two are directly constructed as empty sets.
@petamoriken thanks for the PR! I had some local unfinished code related to this, so I left some drive-by comments in review. I'll leave the final review to @crowlKats, as he's overall more knowledgeable about this. |
@crowlKats please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good!
Fixes #18944
Fixes #16487