From 77c6bfac93bd62e94a0d5c727be3b5bd8b099d02 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Tue, 26 Sep 2017 15:11:14 +0100 Subject: [PATCH] Example should check for current aborted state --- dom.bs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dom.bs b/dom.bs index f833ab643..19bb0d18d 100644 --- a/dom.bs +++ b/dom.bs @@ -1478,6 +1478,10 @@ controller.abort();

 function doAmazingness({signal}) {
+  if (signal.aborted) {
+    return Promise.reject(new DOMException('Aborted', 'AbortError'));
+  }
+
   return new Promise((resolve, reject) => {
     // Begin doing amazingness, and call resolve(result) when done.
     // But also, watch for signals: