summaryrefslogtreecommitdiff
path: root/op_crates/web/03_abort_signal.js
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates/web/03_abort_signal.js')
-rw-r--r--op_crates/web/03_abort_signal.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/op_crates/web/03_abort_signal.js b/op_crates/web/03_abort_signal.js
index 3090513eb..693b5342a 100644
--- a/op_crates/web/03_abort_signal.js
+++ b/op_crates/web/03_abort_signal.js
@@ -14,6 +14,12 @@
#aborted = false;
#abortAlgorithms = new Set();
+ static abort() {
+ const signal = new AbortSignal(illegalConstructorKey);
+ signal[signalAbort]();
+ return signal;
+ }
+
[add](algorithm) {
this.#abortAlgorithms.add(algorithm);
}