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

fix(ext/abort): trigger AbortSignal events in correct order #20095

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ext/web/03_abort_signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ class AbortSignal extends EventTarget {
return;
}
this[abortReason] = reason;
if (this[abortAlgos] !== null) {
for (const algorithm of new SafeSetIterator(this[abortAlgos])) {
algorithm();
}
this[abortAlgos] = null;
}
const algos = this[abortAlgos];
this[abortAlgos] = null;

const event = new Event("abort");
setIsTrusted(event, true);
this.dispatchEvent(event);
if (algos !== null) {
for (const algorithm of new SafeSetIterator(algos)) {
algorithm();
}
}
}

[remove](algorithm) {
Expand Down
8 changes: 2 additions & 6 deletions tools/wpt/expectation.json
Original file line number Diff line number Diff line change
Expand Up @@ -4944,12 +4944,8 @@
"abort": {
"request.any.html": true,
"request.any.worker.html": true,
"general.any.html": [
"Clone aborts with original controller"
],
"general.any.worker.html": [
"Clone aborts with original controller"
],
"general.any.html": true,
"general.any.worker.html": true,
"cache.https.any.html": false,
"cache.https.any.worker.html": false
},
Expand Down