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

feat(ext/web): add AbortSignal.any() #21087

Merged
merged 14 commits into from
Nov 13, 2023
Next Next commit
tweak
  • Loading branch information
petamoriken committed Nov 4, 2023
commit 81108027bbfb3fc079894c74a5b99fa75259f117
8 changes: 3 additions & 5 deletions ext/web/03_abort_signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ class AbortSignal extends EventTarget {
if (this.aborted) {
return;
}
if (this[abortAlgos] === null) {
this[abortAlgos] = new SafeSet();
}
this[abortAlgos] ??= new SafeSet();
SetPrototypeAdd(this[abortAlgos], algorithm);
}

Expand All @@ -91,7 +89,7 @@ class AbortSignal extends EventTarget {

const event = new Event("abort");
setIsTrusted(event, true);
this.dispatchEvent(event);
super.dispatchEvent(event);
if (algos !== null) {
for (const algorithm of new SafeSetIterator(algos)) {
algorithm();
Expand All @@ -104,7 +102,7 @@ class AbortSignal extends EventTarget {
}

constructor(key = null) {
if (key != illegalConstructorKey) {
if (key !== illegalConstructorKey) {
throw new TypeError("Illegal constructor.");
}
super();
Expand Down