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
Prev Previous commit
Next Next commit
fix
  • Loading branch information
petamoriken committed Nov 4, 2023
commit 31e9e484248ff7156f0e671454235005dd2d1df0
7 changes: 3 additions & 4 deletions ext/web/03_abort_signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ class WeakRefSet {
if (WeakSetPrototypeHas(this.#weakSet, value)) {
return;
}
const ref = new SafeWeakRef(value);
WeakSetPrototypeAdd(this.#weakSet, value);
SetPrototypeAdd(this.#refSet, ref);
SetPrototypeAdd(this.#refSet, new SafeWeakRef(value));
}

has(value) {
Expand All @@ -57,7 +56,7 @@ class WeakRefSet {
for (const ref of new SafeSetIterator(this.#refSet)) {
const value = WeakRefPrototypeDeref(ref);
if (value !== undefined) {
ArrayPrototypePush(value);
ArrayPrototypePush(arr, value);
}
}
return arr;
Expand Down Expand Up @@ -188,7 +187,7 @@ class AbortSignal extends EventTarget {
const signals = this[dependentSignals];
if (signals !== null) {
const signalArray = signals.toArray();
for (let i = 0; i < signalArray; ++i) {
for (let i = 0; i < signalArray.length; ++i) {
const signal = signalArray[i];
signal[signalAbort](reason);
}
Expand Down