From 565ca574257022b87856ed544cd733ced5e2d758 Mon Sep 17 00:00:00 2001 From: Steve Anton Date: Wed, 12 Jul 2023 12:42:22 -0700 Subject: [PATCH] chore: Add polyfill for AbortSignal.throwIfAborted() (#5412) --- lib/polyfill/abort_controller.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/polyfill/abort_controller.js b/lib/polyfill/abort_controller.js index 3ebf1acc6e..ddb5fe3c66 100644 --- a/lib/polyfill/abort_controller.js +++ b/lib/polyfill/abort_controller.js @@ -86,6 +86,13 @@ class extends shaka.util.FakeEventTarget { return this.reason_; } + /** @return {void} */ + throwIfAborted() { + if (this.aborted_) { + throw this.reason_; + } + } + /** * @param {*} reason * @private